RTAB-Map 0.23.10
Real-Time Appearance-Based Mapping
Loading...
Searching...
No Matches
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/utilite_export.h" // DLL export/import defines
24
25#include <string>
26#include <vector>
27#include <stdarg.h>
28
51std::string UTILITE_EXPORT uReplaceChar(const std::string & str, char before, char after);
52
67std::string UTILITE_EXPORT uReplaceChar(const std::string & str, char before, const std::string & after);
68
80std::string UTILITE_EXPORT uToUpperCase(const std::string & str);
81
93std::string UTILITE_EXPORT uToLowerCase(const std::string & str);
94
110std::string UTILITE_EXPORT uNumber2Str(unsigned int number);
111
127std::string UTILITE_EXPORT uNumber2Str(int number);
128
149std::string UTILITE_EXPORT uNumber2Str(float number, int precision=6, bool fixed = false);
150
171std::string UTILITE_EXPORT uNumber2Str(double number, int precision=6, bool fixed = false);
172
178int UTILITE_EXPORT uStr2Int(const std::string & str);
179
185float UTILITE_EXPORT uStr2Float(const std::string & str);
186
192double UTILITE_EXPORT uStr2Double(const std::string & str);
193
194
201std::string UTILITE_EXPORT uBool2Str(bool boolean);
209bool UTILITE_EXPORT uStr2Bool(const char * str);
210bool UTILITE_EXPORT uStr2Bool(const std::string & str);
211
217std::vector<unsigned char> UTILITE_EXPORT uStr2Bytes(const std::string & str);
218
224std::string UTILITE_EXPORT uBytes2Str(const std::vector<unsigned char> & bytes);
225
241std::string UTILITE_EXPORT uBytes2Hex(const char * bytes, unsigned int bytesLen);
256std::vector<char> UTILITE_EXPORT uHex2Bytes(const std::string & hex);
271std::vector<char> UTILITE_EXPORT uHex2Bytes(const char * hex, int hexLen);
272
289std::string UTILITE_EXPORT uHex2Str(const std::string & hex);
290
303unsigned char UTILITE_EXPORT uHex2Ascii(const unsigned char & c, bool rightPart);
304
317unsigned char UTILITE_EXPORT uAscii2Hex(const unsigned char & c);
318
322std::string UTILITE_EXPORT uFormatv (const char *fmt, va_list ap);
323
327std::string UTILITE_EXPORT uFormat (const char *fmt, ...)
328#if defined(__GNUC__) || defined(__clang__)
329 // Compiler-checked format string (see the note on ULogger::write).
330 __attribute__((format(printf, 1, 2)))
331#endif
332 ;
333
334#ifdef _WIN32
339UTILITE_EXPORT wchar_t * createWCharFromChar(const char * text);
340
345UTILITE_EXPORT char * createCharFromWChar(const wchar_t * wText);
346#endif
347
348#endif /* UCONVERSION_H */
std::string UTILITE_EXPORT uBytes2Str(const std::vector< unsigned char > &bytes)
unsigned char UTILITE_EXPORT uHex2Ascii(const unsigned char &c, bool rightPart)
int UTILITE_EXPORT uStr2Int(const std::string &str)
std::string UTILITE_EXPORT uToLowerCase(const std::string &str)
std::string UTILITE_EXPORT uBytes2Hex(const char *bytes, unsigned int bytesLen)
std::string UTILITE_EXPORT uFormat(const char *fmt,...)
unsigned char UTILITE_EXPORT uAscii2Hex(const unsigned char &c)
std::string UTILITE_EXPORT uHex2Str(const std::string &hex)
std::string UTILITE_EXPORT uFormatv(const char *fmt, va_list ap)
double UTILITE_EXPORT uStr2Double(const std::string &str)
std::string UTILITE_EXPORT uNumber2Str(unsigned int number)
std::vector< unsigned char > UTILITE_EXPORT uStr2Bytes(const std::string &str)
float UTILITE_EXPORT uStr2Float(const std::string &str)
std::vector< char > UTILITE_EXPORT uHex2Bytes(const std::string &hex)
bool UTILITE_EXPORT uStr2Bool(const char *str)
std::string UTILITE_EXPORT uReplaceChar(const std::string &str, char before, char after)
std::string UTILITE_EXPORT uBool2Str(bool boolean)
std::string UTILITE_EXPORT uToUpperCase(const std::string &str)