MofileReader
moFileReaderSingleton Class Reference

Convenience Class. More...

#include <moFileReader.hpp>

+ Inheritance diagram for moFileReaderSingleton:
+ Collaboration diagram for moFileReaderSingleton:

Static Public Member Functions

static moFileReaderSingletonGetInstance ()
 Singleton-Accessor. More...
 
- Static Public Member Functions inherited from moFileReader
static eErrorCode ExportAsHTML (const std::string &infile, const std::string &filename="", const std::string &css=g_css)
 Exports the whole content of the .mo-File as .html. More...
 

Additional Inherited Members

- Public Types inherited from moFileReader
enum  eErrorCode {
  EC_SUCCESS = 0 , EC_ERROR , EC_FILENOTFOUND , EC_FILEINVALID ,
  EC_TABLEEMPTY , EC_MAGICNUMBER_NOMATCH , EC_MAGICNUMBER_REVERSED
}
 The possible errorcodes for methods of this class. More...
 
- Public Member Functions inherited from moFileReader
moFileReader::eErrorCode ParseData (const std::string &data)
 Reads a .mo-file. More...
 
eErrorCode ReadFile (const char *filename)
 Reads a .mo-file. More...
 
template<typename T >
eErrorCode ReadStream (T &stream)
 Reads data from a stream. More...
 
std::string Lookup (const char *id) const
 Returns the searched translation or returns the input. More...
 
std::string LookupWithContext (const char *context, const char *id) const
 Returns the searched translation or returns the input, restricted to the context given by context. See https://www.gnu.org/software/gettext/manual/html_node/Contexts.html for more info. More...
 
const std::string & GetErrorDescription () const
 Returns the Error Description. More...
 
void ClearTable ()
 Empties the Lookup-Table. More...
 
unsigned int GetNumStrings () const
 Returns the Number of Entries in our Lookup-Table. More...
 
- Static Public Attributes inherited from moFileReader
static const unsigned int MagicNumber = 0x950412DE
 The Magic Number describes the endianess of bytes on the system. More...
 
static const unsigned int MagicReversed = 0xDE120495
 If the Magic Number is Reversed, we need to swap the bytes. More...
 
static const char ContextSeparator = '\x04'
 The character that is used to separate context strings. More...
 
- Protected Types inherited from moFileReader
typedef std::map< std::string, std::string > moLookupList
 Type for the map which holds the translation-pairs later. More...
 
typedef std::map< std::string, moLookupListmoContextLookupList
 Type for the 2D map which holds the translation-pairs later. More...
 
- Protected Member Functions inherited from moFileReader
unsigned long SwapBytes (unsigned long in)
 Swap the endianness of a 4 byte WORD. More...
 
- Protected Attributes inherited from moFileReader
std::string m_error
 Keeps the last error as String. More...
 

Detailed Description

Convenience Class.

This class derives from moFileReader and builds a singleton to access its methods in a global manner.

Note
This class is a Singleton. Please access it via moFileReaderSingleton::GetInstance() or use the provided wrappers:

Definition at line 767 of file moFileReader.hpp.

Member Function Documentation

◆ GetInstance()

static moFileReaderSingleton& moFileReaderSingleton::GetInstance ( )
inlinestatic

Singleton-Accessor.

Returns
A static instance of moFileReaderSingleton.

Definition at line 787 of file moFileReader.hpp.


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