ManaPlus
Public Member Functions | Protected Member Functions | Private Attributes | Friends
PoDict Class Reference

#include <podict.h>

Public Member Functions

 PoDict (const std::string &lang)
 
 ~PoDict ()
 
const std::string getStr (const std::string &str)
 
const char * getChar (const char *const str)
 
bool haveStr (const std::string &str) const
 

Protected Member Functions

PoMapgetMap ()
 
void set (const std::string &key, const std::string &value)
 
void setLang (const std::string &lang)
 

Private Attributes

PoMap mPoLines
 
std::string mLang
 

Friends

class PoParser
 
class TranslationManager
 

Detailed Description

Definition at line 32 of file podict.h.

Constructor & Destructor Documentation

◆ PoDict()

PoDict::PoDict ( const std::string &  lang)
explicit

Definition at line 35 of file podict.cpp.

35  :
36  mPoLines(),
37  mLang(lang)
38 {
39 }
std::string mLang
Definition: podict.h:64
PoMap mPoLines
Definition: podict.h:63

◆ ~PoDict()

PoDict::~PoDict ( )

Definition at line 41 of file podict.cpp.

42 {
43 }

Member Function Documentation

◆ getChar()

const char * PoDict::getChar ( const char *const  str)

Definition at line 52 of file podict.cpp.

53 {
54  if (mPoLines.find(str) == mPoLines.end())
55  return str;
56  return mPoLines[str].c_str();
57 }

References mPoLines.

Referenced by HelpWindow::search().

◆ getMap()

PoMap* PoDict::getMap ( )
inlineprotected

Definition at line 53 of file podict.h.

54  { return &mPoLines; }

References mPoLines.

◆ getStr()

const std::string PoDict::getStr ( const std::string &  str)

◆ haveStr()

bool PoDict::haveStr ( const std::string &  str) const

Definition at line 59 of file podict.cpp.

60 {
61  return mPoLines.find(str) != mPoLines.end();
62 }

References mPoLines.

◆ set()

void PoDict::set ( const std::string &  key,
const std::string &  value 
)
inlineprotected

Definition at line 56 of file podict.h.

57  { mPoLines[key] = value; }

References mPoLines.

Referenced by PoParser::load(), and TranslationManager::reverseLang().

◆ setLang()

void PoDict::setLang ( const std::string &  lang)
inlineprotected

Definition at line 59 of file podict.h.

60  { mLang = lang; }

References mLang.

Friends And Related Function Documentation

◆ PoParser

friend class PoParser
friend

Definition at line 50 of file podict.h.

◆ TranslationManager

friend class TranslationManager
friend

Definition at line 51 of file podict.h.

Field Documentation

◆ mLang

std::string PoDict::mLang
private

Definition at line 64 of file podict.h.

Referenced by TranslationManager::reverseLang(), and setLang().

◆ mPoLines

PoMap PoDict::mPoLines
private

Definition at line 63 of file podict.h.

Referenced by getChar(), getMap(), getStr(), haveStr(), TranslationManager::reverseLang(), and set().


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