0.07.7
C++ Open Travel Request Parsing Library
UTF8Handler.hpp
Go to the documentation of this file.
1
#ifndef __OPENTREP_BAS_UTF8HANDLER_HPP
2
#define __OPENTREP_BAS_UTF8HANDLER_HPP
3
4
// //////////////////////////////////////////////////////////////////////
5
// Import section
6
// //////////////////////////////////////////////////////////////////////
7
// STL
8
#include <string>
9
10
namespace
OPENTREP
{
11
19
class
UTF8Handler
{
20
public
:
21
/*
22
* Conversion from a UTF-8-encoded "simple character" (though
23
* potentially multi-byte) STL string into a wide character STL
24
* string.
25
*
26
* Note that as there is no checks of appropriate encoding, it
27
* only works for valid UTF-8, i.e. no 5- or 6-byte sequences.
28
*
29
* Note that the "simple characters", within a STL string, may be
30
* multi-byte (e.g., if they are UTF-8-encoded).
31
*
32
* @param std::string The "simple character" (though potentially
33
* multi-byte) STL string.
34
* @return std::wstring The wide character STL string.
35
*/
36
static
std::wstring
toWideString
(
const
std::string& iSrc);
37
38
/*
39
* Conversion from a wide character STL string into a UTF-8-encoded
40
* "simple character" (though potentially multi-byte) STL string.
41
*
42
* Note that as there is no checks of appropriate encoding, it
43
* only works for valid UTF-8, i.e. no 5- or 6-byte sequences.
44
*
45
* Note that the "simple characters", within a STL string, may be
46
* multi-byte (e.g., if they are UTF-8-encoded).
47
*
48
* @param std::wstring The wide character STL string.
49
* @return std::string The "simple character" (though potentially
50
* multi-byte) STL string.
51
*/
52
static
std::string
toSimpleString
(
const
std::wstring& iStr);
53
57
static
std::string
displayCharString
(
const
char
* iString);
58
63
static
std::string
displaySTLWString
(
const
std::wstring& iString);
64
};
65
66
}
67
#endif // __OPENTREP_BAS_UTF8HANDLER_HPP
OPENTREP::UTF8Handler::toSimpleString
static std::string toSimpleString(const std::wstring &iStr)
Definition:
UTF8Handler.cpp:98
OPENTREP::UTF8Handler::displayCharString
static std::string displayCharString(const char *iString)
Definition:
UTF8Handler.cpp:151
OPENTREP
Definition:
BasChronometer.cpp:10
OPENTREP::UTF8Handler::toWideString
static std::wstring toWideString(const std::string &iSrc)
Definition:
UTF8Handler.cpp:37
OPENTREP::UTF8Handler
Utility class for basic handling of UTF-8 encoded strings.
Definition:
UTF8Handler.hpp:19
OPENTREP::UTF8Handler::displaySTLWString
static std::string displaySTLWString(const std::wstring &iString)
Definition:
UTF8Handler.cpp:172
Generated on Sat Aug 1 2020 00:00:00 for OpenTREP by
1.8.18