liblcf
encoder.h
Go to the documentation of this file.
1
/*
2
* This file is part of liblcf. Copyright (c) 2020 liblcf authors.
3
* https://github.com/EasyRPG/liblcf - https://easyrpg.org
4
*
5
* liblcf is Free/Libre Open Source Software, released under the MIT License.
6
* For the full copyright and license information, please view the COPYING
7
* file that was distributed with this source code.
8
*/
9
10
#ifndef LCF_ENCODER_H
11
#define LCF_ENCODER_H
12
#include <vector>
13
#include <string>
14
15
class
Encoder
{
16
public
:
17
explicit
Encoder
(std::string encoding);
18
19
Encoder
(
const
Encoder
&) =
delete
;
20
Encoder
&
operator=
(
const
Encoder
&) =
delete
;
21
22
~Encoder
();
23
24
void
Encode
(std::string& str);
25
void
Decode
(std::string& str);
26
27
bool
IsOk
()
const
;
28
29
const
std::string&
GetEncoding
()
const
;
30
private
:
31
void
Init
();
32
void
Reset
();
33
void
Convert
(std::string& str,
void
* conv_dst,
void
* conv_src);
34
private
:
35
void
*
_conv_storage
=
nullptr
;
36
void
*
_conv_runtime
=
nullptr
;
37
std::vector<char>
_buffer
;
38
std::string
_encoding
;
39
};
40
41
42
inline
const
std::string&
Encoder::GetEncoding
()
const
{
43
return
_encoding
;
44
}
45
46
#endif
Encoder::_buffer
std::vector< char > _buffer
Definition:
encoder.h:37
Encoder::Encode
void Encode(std::string &str)
Definition:
encoder.cpp:63
Encoder::Decode
void Decode(std::string &str)
Definition:
encoder.cpp:70
Encoder::_conv_runtime
void * _conv_runtime
Definition:
encoder.h:36
Encoder::Encoder
Encoder(const Encoder &)=delete
Encoder::Reset
void Reset()
Definition:
encoder.cpp:115
Encoder::GetEncoding
const std::string & GetEncoding() const
Definition:
encoder.h:42
Encoder::Init
void Init()
Definition:
encoder.cpp:77
Encoder::IsOk
bool IsOk() const
Definition:
encoder.cpp:59
Encoder::Convert
void Convert(std::string &str, void *conv_dst, void *conv_src)
Definition:
encoder.cpp:125
Encoder
Definition:
encoder.h:15
Encoder::_encoding
std::string _encoding
Definition:
encoder.h:38
Encoder::_conv_storage
void * _conv_storage
Definition:
encoder.h:35
Encoder::operator=
Encoder & operator=(const Encoder &)=delete
Encoder::~Encoder
~Encoder()
Definition:
encoder.cpp:55
Encoder::Encoder
Encoder(std::string encoding)
Definition:
encoder.cpp:49
src
encoder.h
Generated on Sun Aug 2 2020 00:00:00 for liblcf by
1.8.18