liblcf
Encoder Class Reference

#include <encoder.h>

+ Collaboration diagram for Encoder:

Public Member Functions

 Encoder (std::string encoding)
 
 Encoder (const Encoder &)=delete
 
Encoderoperator= (const Encoder &)=delete
 
 ~Encoder ()
 
void Encode (std::string &str)
 
void Decode (std::string &str)
 
bool IsOk () const
 
const std::string & GetEncoding () const
 

Private Member Functions

void Init ()
 
void Reset ()
 
void Convert (std::string &str, void *conv_dst, void *conv_src)
 

Private Attributes

void * _conv_storage = nullptr
 
void * _conv_runtime = nullptr
 
std::vector< char > _buffer
 
std::string _encoding
 

Detailed Description

Definition at line 15 of file encoder.h.

Constructor & Destructor Documentation

◆ Encoder() [1/2]

Encoder::Encoder ( std::string  encoding)
explicit

Definition at line 49 of file encoder.cpp.

References Init().

+ Here is the call graph for this function:

◆ Encoder() [2/2]

Encoder::Encoder ( const Encoder )
delete

◆ ~Encoder()

Encoder::~Encoder ( )

Definition at line 55 of file encoder.cpp.

References Reset().

+ Here is the call graph for this function:

Member Function Documentation

◆ Convert()

void Encoder::Convert ( std::string &  str,
void *  conv_dst,
void *  conv_src 
)
private

Definition at line 125 of file encoder.cpp.

References _buffer.

Referenced by Decode(), and Encode().

+ Here is the caller graph for this function:

◆ Decode()

void Encoder::Decode ( std::string &  str)

Definition at line 70 of file encoder.cpp.

References _conv_runtime, _conv_storage, _encoding, and Convert().

Referenced by LcfWriter::Decode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Encode()

void Encoder::Encode ( std::string &  str)

Definition at line 63 of file encoder.cpp.

References _conv_runtime, _conv_storage, _encoding, and Convert().

Referenced by LcfReader::Encode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetEncoding()

const std::string & Encoder::GetEncoding ( ) const
inline

Definition at line 42 of file encoder.h.

References _encoding.

◆ Init()

void Encoder::Init ( )
private

Definition at line 77 of file encoder.cpp.

References _conv_runtime, _conv_storage, _encoding, ReaderUtil::CodepageToEncoding(), and makeScopeGuard().

Referenced by Encoder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsOk()

bool Encoder::IsOk ( ) const

Definition at line 59 of file encoder.cpp.

References _conv_runtime, _conv_storage, and _encoding.

Referenced by LcfWriter::IsOk(), and LcfReader::IsOk().

+ Here is the caller graph for this function:

◆ operator=()

Encoder& Encoder::operator= ( const Encoder )
delete

◆ Reset()

void Encoder::Reset ( )
private

Definition at line 115 of file encoder.cpp.

References _conv_runtime, and _conv_storage.

Referenced by ~Encoder().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _buffer

std::vector<char> Encoder::_buffer
private

Definition at line 37 of file encoder.h.

Referenced by Convert().

◆ _conv_runtime

void* Encoder::_conv_runtime = nullptr
private

Definition at line 36 of file encoder.h.

Referenced by Decode(), Encode(), Init(), IsOk(), and Reset().

◆ _conv_storage

void* Encoder::_conv_storage = nullptr
private

Definition at line 35 of file encoder.h.

Referenced by Decode(), Encode(), Init(), IsOk(), and Reset().

◆ _encoding

std::string Encoder::_encoding
private

Definition at line 38 of file encoder.h.

Referenced by Decode(), Encode(), GetEncoding(), Init(), and IsOk().


The documentation for this class was generated from the following files: