File contains the realizations of the functions, defined in the tlefunc.h file and used by the TLELib library. More...
#include <cmath>#include <cstdio>#include <cstdlib>#include <iostream>#include <tlelib/tlefunc.h>#include <tlelib/tleexception.h>Go to the source code of this file.
Namespaces | |
| namespace | tlelib |
Main namespace of TLELib. All objects and functions of this library are located in the 'tlelib' namespace. | |
Defines | |
| #define | UNIX_FIRST_YEAR 1970 |
Functions | |
| std::string | tlelib::int2string (const int val, const std::size_t fieldLength=0, const bool leftAlign=true) |
| Convert a variable of 'int' type into variable of 'std::string' type. | |
| std::string | tlelib::double2string (const double val, const std::size_t fieldLength, const std::size_t precission=6, const bool scientific=false, const bool decimalPointAssumed=false, const bool leftAlign=true) |
| Convert a variable of 'double' type into variable of 'std::string' type. | |
| std::string | tlelib::string2string (const std::string &str, const std::size_t fieldLength, const bool leftAlign=true, const bool allowCutOff=true) |
| Correct the length of a string: add the spece symbols or cut it off if it's necessary. | |
| std::string | tlelib::date2string (const double date, const std::size_t fieldLength, const bool leftAlign=true) |
| Convert a date, defined by the double value, into variable of 'std::string' type. | |
| int | tlelib::string2int (const std::string &str) |
| Convert a string into integer variable. | |
| double | tlelib::string2double (const std::string &str) |
| Convert a string into 'double' variable. | |
| std::string | tlelib::trim (const std::string &str) |
| Remove the spaces from the start and end of the given string. | |
| char | tlelib::parseChar (const std::string *line, const std::size_t index) |
| Take a symbol at the given position from the given string. | |
| std::string | tlelib::parseString (const std::string *line, const std::size_t start, const std::size_t length) |
| Take a substring of the specified length at the given position from the given string. | |
| int | tlelib::parseInt (const std::string *line, const std::size_t start, const std::size_t length) |
| Take a substring from the given string and convert it by the string2int() function. | |
| double | tlelib::parseDouble (const std::string *line, const std::size_t start, const std::size_t length, const bool decimalPointAssumed=false) |
| Take a substring from the given string and convert it by the string2double() function. | |
| double | tlelib::string2date (const std::string &str) |
| Convert a string into date: number of seconds (including fractional part) since Jan 1, UNIX_FIRST_YEAR. | |
| int | tlelib::checksum (const std::string &str) |
| Calculate the checksum for the given string, using the Modulo 10 algorithm. | |
File contains the realizations of the functions, defined in the tlefunc.h file and used by the TLELib library.
Definition in file tlefunc.cpp.
| #define UNIX_FIRST_YEAR 1970 |
Definition at line 26 of file tlefunc.cpp.
Referenced by tlelib::date2string(), and tlelib::string2date().