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 "utilite/UtiLiteExp.h" // DLL export/import defines
24 
25 #include <string>
26 #include <vector>
27 #include <stdarg.h>
28 
51 std::string uReplaceChar(const std::string & str, char before, char after);
52 
67 std::string uReplaceChar(const std::string & str, char before, const std::string & after);
68 
80 std::string uToUpperCase(const std::string & str);
81 
93 std::string uToLowerCase(const std::string & str);
94 
100 std::string uNumber2Str(unsigned int number);
106 std::string uNumber2Str(int number);
112 std::string uNumber2Str(float number);
118 std::string uNumber2Str(double number);
119 
126 std::string uBool2Str(bool boolean);
134 bool uStr2Bool(const char * str);
135 
151 std::string uBytes2Hex(const char * bytes, unsigned int bytesLen);
166 std::vector<char> uHex2Bytes(const std::string & hex);
181 std::vector<char> uHex2Bytes(const char * hex, int hexLen);
182 
199 std::string uHex2Str(const std::string & hex);
200 
213 unsigned char uHex2Ascii(const unsigned char & c, bool rightPart);
214 
227 unsigned char uAscii2Hex(const unsigned char & c);
228 
232 std::string uFormatv (const char *fmt, va_list ap);
233 
237 std::string uFormat (const char *fmt, ...);
238 
239 #ifdef WIN32
240 
244 wchar_t * createWCharFromChar(const char * text);
245 
250 char * createCharFromWChar(const wchar_t * wText);
251 #endif
252 
253 #endif /* UCONVERSION_H */
std::string uFormatv(const char *fmt, va_list ap)
bool uStr2Bool(const char *str)
std::string uToUpperCase(const std::string &str)
Definition: UConversion.cpp:61
std::string uFormat(const char *fmt,...)
std::vector< char > uHex2Bytes(const std::string &hex)
unsigned char uHex2Ascii(const unsigned char &c, bool rightPart)
std::string uBool2Str(bool boolean)
std::string uHex2Str(const std::string &hex)
std::string uReplaceChar(const std::string &str, char before, char after)
Definition: UConversion.cpp:31
std::string uBytes2Hex(const char *bytes, unsigned int bytesLen)
std::string uNumber2Str(unsigned int number)
Definition: UConversion.cpp:89
std::string uToLowerCase(const std::string &str)
Definition: UConversion.cpp:75
unsigned char uAscii2Hex(const unsigned char &c)


find_object_2d
Author(s): Mathieu Labbe
autogenerated on Mon Jun 10 2019 13:21:31