TLELib  0.1.0
tlefunc.h File Reference

File contains the prototypes of functions, used by TLELib library. More...

#include <string>
#include <ctime>

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.


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.
double tlelib::string2date (const std::string &str)
 Convert a string into date: number of seconds (including fractional part) since Jan 1, UNIX_FIRST_YEAR.
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.
int tlelib::checksum (const std::string &str)
 Calculate the checksum for the given string, using the Modulo 10 algorithm.

Detailed Description

File contains the prototypes of functions, used by TLELib library.

Definition in file tlefunc.h.

 All Classes Namespaces Files Functions Variables Defines