tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
text_encX.hpp
Go to the documentation of this file.
1
7#if !defined(TETENGO_PLATFORMDEPENDENT_TEXTENCODER_HPP)
8#define TETENGO_PLATFORMDEPENDENT_TEXTENCODER_HPP
9
10#include <memory>
11#include <string>
12#include <string_view>
13
14#include <boost/core/noncopyable.hpp>
15
16
18{
22 class text_encoder : private boost::noncopyable
23 {
24 public:
25 // static functions
26
32 [[nodiscard]] static const text_encoder& instance();
33
34
35 // constructors and destructor
36
41
42
43 // functions
44
52 [[nodiscard]] std::string encode_to_cp932(const std::string_view& utf8) const;
53
61 [[nodiscard]] std::string decode_from_cp932(const std::string_view& cp932) const;
62
63
64 private:
65 // types
66
67 class impl;
68
69
70 // variables
71
72 const std::unique_ptr<impl> m_p_impl;
73
74
75 // constructors
76
78 };
79
80
81}
82
83
84#endif
A text encoder.
Definition text_encX.hpp:23
std::string encode_to_cp932(const std::string_view &utf8) const
Encodes a string to CP932.
std::string decode_from_cp932(const std::string_view &cp932) const
Decodes a string from CP932.
~text_encoder()
Destroys the text encoder.
static const text_encoder & instance()
Returns the instance.
Platform dependent processings.