TLELib  0.1.0
tlefunc.h
Go to the documentation of this file.
00001 /*-----------------------------------------------------------------------------+
00002  | TLELib                                                                      |
00003  | Copyright 2011 Sergei V. Fundaev                                            |
00004  +-----------------------------------------------------------------------------+
00005  | This file is part of TLELib.                                                |
00006  |                                                                             |
00007  | TLELib is free software: you can redistribute it and/or modify              |
00008  | it under the terms of the GNU Lesser General Public License as published by |
00009  | the Free Software Foundation, either version 3 of the License, or           |
00010  | (at your option) any later version.                                         |
00011  |                                                                             |
00012  | TLELib is distributed in the hope that it will be useful,                   |
00013  | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00014  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00015  | GNU Lesser General Public License for more details.                         |
00016  |                                                                             |
00017  | You should have received a copy of the GNU Lesser General Public License    |
00018  | along with TLELib. If not, see <http://www.gnu.org/licenses/>.              |
00019  +----------------------------------------------------------------------------*/
00025 #ifndef TLEFUNC_H
00026 #define TLEFUNC_H
00027 
00028 #include <string>
00029 #include <ctime>
00030 
00031 namespace tlelib
00032 {
00033 
00041 std::string int2string(const int val, const std::size_t fieldLength = 0, const bool leftAlign = true);
00042 
00053 std::string 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);
00054 
00063 std::string string2string(const std::string &str, const std::size_t fieldLength, const bool leftAlign = true, const bool allowCutOff = true);
00064 
00072 std::string date2string(const double date, const std::size_t fieldLength, const bool leftAlign = true);
00073 
00079 int string2int(const std::string &str);
00080 
00086 double string2double(const std::string &str);
00087 
00093 double string2date(const std::string &str);
00094 
00100 std::string trim(const std::string& str);
00101 
00108 char parseChar(const std::string *line, const std::size_t index);
00109 
00117 std::string parseString(const std::string *line, const std::size_t start, const std::size_t length);
00118 
00126 int parseInt(const std::string *line, const std::size_t start, const std::size_t length);
00127 
00136 double parseDouble(const std::string *line, const std::size_t start, const std::size_t length, const bool decimalPointAssumed=false);
00137 
00143 int checksum(const std::string &str);
00144 
00145 } // namespace tlelib
00146 #endif // TLEFUNC_H
 All Classes Namespaces Files Functions Variables Defines