LibreOffice Module l10ntools (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
PoEntry Class Reference

Interface to use po entries in localization. More...

#include <po.hxx>

Public Types

enum  TYPE {
  TTEXT ,
  TQUICKHELPTEXT ,
  TTITLE
}
 
enum  Exception {
  NOSOURCFILE ,
  NORESTYPE ,
  NOGROUPID ,
  NOSTRING ,
  WRONGHELPTEXT
}
 

Public Member Functions

 PoEntry ()
 
 PoEntry (std::string_view rSourceFile, std::string_view rResType, std::string_view rGroupId, std::string_view rLocalId, std::string_view rHelpText, const OString &rText, const TYPE eType)
 
 ~PoEntry ()
 
 PoEntry (const PoEntry &rPo)
 
PoEntryoperator= (const PoEntry &rPo)
 
PoEntryoperator= (PoEntry &&rPo) noexcept
 
OString const & getSourceFile () const
 Get name of file from which entry is extracted. More...
 
OString getGroupId () const
 
OString getLocalId () const
 
OString getResourceType () const
 Get the type of component from which entry is extracted. More...
 
TYPE getType () const
 Get the type of entry. More...
 
OString const & getMsgCtxt () const
 
OString const & getMsgId () const
 
OString const & getMsgStr () const
 
bool isFuzzy () const
 

Static Public Member Functions

static bool IsInSameComp (const PoEntry &rPo1, const PoEntry &rPo2)
 Check whether po-s belong to the same localization component. More...
 
static OString genKeyId (const OString &rGenerator)
 

Private Attributes

std::unique_ptr< GenPoEntrym_pGenPo
 
bool m_bIsInitialized
 

Friends

class PoOfstream
 
class PoIfstream
 

Detailed Description

Interface to use po entries in localization.

PoEntry based on GenPoEntry class which stores attributes of general po entry(see po.cxx). It makes easy to get/set all information needed to localize one english(US) string. It contains some basic checkings and some string transformations between po string and string used by localization tools.

Definition at line 33 of file po.hxx.

Member Enumeration Documentation

◆ Exception

Enumerator
NOSOURCFILE 
NORESTYPE 
NOGROUPID 
NOSTRING 
WRONGHELPTEXT 

Definition at line 46 of file po.hxx.

◆ TYPE

Enumerator
TTEXT 
TQUICKHELPTEXT 
TTITLE 

Definition at line 45 of file po.hxx.

Constructor & Destructor Documentation

◆ PoEntry() [1/3]

PoEntry::PoEntry ( )

Definition at line 237 of file po.cxx.

◆ PoEntry() [2/3]

PoEntry::PoEntry ( std::string_view  rSourceFile,
std::string_view  rResType,
std::string_view  rGroupId,
std::string_view  rLocalId,
std::string_view  rHelpText,
const OString &  rText,
const TYPE  eType 
)

◆ ~PoEntry()

PoEntry::~PoEntry ( )

Definition at line 288 of file po.cxx.

◆ PoEntry() [3/3]

PoEntry::PoEntry ( const PoEntry rPo)

Definition at line 292 of file po.cxx.

Member Function Documentation

◆ genKeyId()

OString PoEntry::genKeyId ( const OString &  rGenerator)
static

Definition at line 415 of file po.cxx.

Referenced by MergeEntrys::GetQTZText(), MergeDataFile::InsertEntry(), and PoEntry().

◆ getGroupId()

OString PoEntry::getGroupId ( ) const

Definition at line 336 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

Referenced by checkMathSymbolNames(), IsInSameComp(), and MergeDataFile::MergeDataFile().

◆ getLocalId()

OString PoEntry::getLocalId ( ) const

Definition at line 342 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

Referenced by IsInSameComp(), and MergeDataFile::MergeDataFile().

◆ getMsgCtxt()

const OString & PoEntry::getMsgCtxt ( ) const

Definition at line 384 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

Referenced by checkFunctionNames(), and checkStyleNames().

◆ getMsgId()

OString const & PoEntry::getMsgId ( ) const

◆ getMsgStr()

const OString & PoEntry::getMsgStr ( ) const

◆ getResourceType()

OString PoEntry::getResourceType ( ) const

Get the type of component from which entry is extracted.

Definition at line 352 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

Referenced by IsInSameComp(), and MergeDataFile::MergeDataFile().

◆ getSourceFile()

OString const & PoEntry::getSourceFile ( ) const

Get name of file from which entry is extracted.

Definition at line 330 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

Referenced by IsInSameComp(), and MergeDataFile::MergeDataFile().

◆ getType()

PoEntry::TYPE PoEntry::getType ( ) const

Get the type of entry.

Definition at line 362 of file po.cxx.

References m_bIsInitialized, m_pGenPo, sType, TQUICKHELPTEXT, TTEXT, and TTITLE.

Referenced by MergeDataFile::MergeDataFile().

◆ isFuzzy()

bool PoEntry::isFuzzy ( ) const

◆ IsInSameComp()

bool PoEntry::IsInSameComp ( const PoEntry rPo1,
const PoEntry rPo2 
)
static

Check whether po-s belong to the same localization component.

Definition at line 406 of file po.cxx.

References getGroupId(), getLocalId(), getResourceType(), getSourceFile(), and m_bIsInitialized.

Referenced by MergeDataFile::MergeDataFile().

◆ operator=() [1/2]

PoEntry & PoEntry::operator= ( const PoEntry rPo)

Definition at line 298 of file po.cxx.

References m_bIsInitialized, and m_pGenPo.

◆ operator=() [2/2]

PoEntry & PoEntry::operator= ( PoEntry &&  rPo)
noexcept

Definition at line 323 of file po.cxx.

Friends And Related Function Documentation

◆ PoIfstream

friend class PoIfstream
friend

Definition at line 43 of file po.hxx.

◆ PoOfstream

friend class PoOfstream
friend

Definition at line 42 of file po.hxx.

Member Data Documentation

◆ m_bIsInitialized

bool PoEntry::m_bIsInitialized
private

◆ m_pGenPo

std::unique_ptr<GenPoEntry> PoEntry::m_pGenPo
private

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