UConversion.h
Go to the documentation of this file.
1 /*
2 * utilite is a cross-platform library with
3 * useful utilities for fast and small developing.
4 * Copyright (C) 2010 Mathieu Labbe
5 *
6 * utilite is free library: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * utilite is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef UCONVERSION_H
21 #define UCONVERSION_H
22 
23 #include "rtabmap/utilite/UtiLiteExp.h" // DLL export/import defines
24 
25 #include <string>
26 #include <vector>
27 #include <stdarg.h>
28 
51 std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, char after);
52 
67 std::string UTILITE_EXP uReplaceChar(const std::string & str, char before, const std::string & after);
68 
80 std::string UTILITE_EXP uToUpperCase(const std::string & str);
81 
93 std::string UTILITE_EXP uToLowerCase(const std::string & str);
94 
100 std::string UTILITE_EXP uNumber2Str(unsigned int number);
106 std::string UTILITE_EXP uNumber2Str(int number);
112 std::string UTILITE_EXP uNumber2Str(float number);
118 std::string UTILITE_EXP uNumber2Str(double number);
119 
125 int UTILITE_EXP uStr2Int(const std::string & str);
126 
132 float UTILITE_EXP uStr2Float(const std::string & str);
133 
139 double UTILITE_EXP uStr2Double(const std::string & str);
140 
141 
148 std::string UTILITE_EXP uBool2Str(bool boolean);
156 bool UTILITE_EXP uStr2Bool(const char * str);
157 bool UTILITE_EXP uStr2Bool(const std::string & str);
158 
164 std::vector<unsigned char> UTILITE_EXP uStr2Bytes(const std::string & str);
165 
171 std::string UTILITE_EXP uBytes2Str(const std::vector<unsigned char> & bytes);
172 
188 std::string UTILITE_EXP uBytes2Hex(const char * bytes, unsigned int bytesLen);
203 std::vector<char> UTILITE_EXP uHex2Bytes(const std::string & hex);
218 std::vector<char> UTILITE_EXP uHex2Bytes(const char * hex, int hexLen);
219 
236 std::string UTILITE_EXP uHex2Str(const std::string & hex);
237 
250 unsigned char UTILITE_EXP uHex2Ascii(const unsigned char & c, bool rightPart);
251 
264 unsigned char UTILITE_EXP uAscii2Hex(const unsigned char & c);
265 
269 std::string UTILITE_EXP uFormatv (const char *fmt, va_list ap);
270 
274 std::string UTILITE_EXP uFormat (const char *fmt, ...);
275 
276 #ifdef _WIN32
277 
281 UTILITE_EXP wchar_t * createWCharFromChar(const char * text);
282 
287 UTILITE_EXP char * createCharFromWChar(const wchar_t * wText);
288 #endif
289 
290 #endif /* UCONVERSION_H */
int UTILITE_EXP uStr2Int(const std::string &str)
std::string UTILITE_EXP uToUpperCase(const std::string &str)
Definition: UConversion.cpp:62
std::string UTILITE_EXP uBytes2Hex(const char *bytes, unsigned int bytesLen)
double UTILITE_EXP uStr2Double(const std::string &str)
std::string UTILITE_EXP uToLowerCase(const std::string &str)
Definition: UConversion.cpp:76
unsigned char UTILITE_EXP uHex2Ascii(const unsigned char &c, bool rightPart)
#define UTILITE_EXP
Definition: UtiLiteExp.h:33
bool UTILITE_EXP uStr2Bool(const char *str)
float UTILITE_EXP uStr2Float(const std::string &str)
std::string UTILITE_EXP uBool2Str(bool boolean)
unsigned char UTILITE_EXP uAscii2Hex(const unsigned char &c)
std::vector< char > UTILITE_EXP uHex2Bytes(const std::string &hex)
std::string UTILITE_EXP uHex2Str(const std::string &hex)
std::string UTILITE_EXP uReplaceChar(const std::string &str, char before, char after)
Definition: UConversion.cpp:32
std::string UTILITE_EXP uFormatv(const char *fmt, va_list ap)
std::vector< unsigned char > UTILITE_EXP uStr2Bytes(const std::string &str)
std::string UTILITE_EXP uBytes2Str(const std::vector< unsigned char > &bytes)
std::string UTILITE_EXP uFormat(const char *fmt,...)
std::string UTILITE_EXP uNumber2Str(unsigned int number)
Definition: UConversion.cpp:90


rtabmap
Author(s): Mathieu Labbe
autogenerated on Wed Jun 5 2019 22:43:40