diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2012-09-02 21:10:35 +0200 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2012-09-03 10:48:07 +0000 |
commit | 42a2fb1c24750dde53b737d1fb45e2bb7286a3f2 (patch) | |
tree | a97d5abd1512797fb5434f098e3ba280206bf26b /l10ntools/inc | |
parent | dd83185b004e08fe0b291ede225d0e93be27c819 (diff) |
Make interface for PoEntry
Use composition insted of inheritance
Make all necessary method.
Make header file clear
Make header file clear
Plus cleanup.
Change-Id: Idfcc7a4a4f51b402ec86a9685e8ad9fdb23fea71
Reviewed-on: https://gerrit.libreoffice.org/530
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'l10ntools/inc')
-rw-r--r-- | l10ntools/inc/po.hxx | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/l10ntools/inc/po.hxx b/l10ntools/inc/po.hxx index df3004c1fe5e..b4b18c49d980 100644 --- a/l10ntools/inc/po.hxx +++ b/l10ntools/inc/po.hxx @@ -39,27 +39,20 @@ public: virtual OString getTransStr() const { return m_sTransStr; } virtual bool getFuzzy() const { return m_bFuzzy; } - virtual void setWhiteSpace(const OString& rWhiteSpace) - { m_sWhiteSpace = rWhiteSpace; } - virtual void setExtractCom(const OString& rExtractCom) - { m_sExtractCom = rExtractCom; } - virtual void setReference(const OString& rReference) - { m_sReference = rReference; } - virtual void setContext(const OString& rContext) - { m_sContext = rContext; } - virtual void setUnTransStr(const OString& rUnTransStr) - { m_sUnTransStr = rUnTransStr; } - virtual void setTransStr(const OString& rTransStr) - { m_sTransStr = rTransStr; } - virtual void setFuzzy(bool bFuzzy) - { m_bFuzzy = bFuzzy; } + virtual void setWhiteSpace(const OString& rWhiteSpace); + virtual void setExtractCom(const OString& rExtractCom); + virtual void setReference(const OString& rReference); + virtual void setContext(const OString& rContext); + virtual void setUnTransStr(const OString& rUnTransStr); + virtual void setTransStr(const OString& rTransStr); + virtual void setFuzzy(const bool bFuzzy); virtual void genKeyId(); virtual void writeToFile(std::ofstream& rOFStream); virtual void readFromFile(std::ifstream& rIFStream); }; -class PoEntry: public GenPoEntry +class PoEntry { public: enum SDFPARTS { PROJECT, SOURCEFILE, DUMMY, RESOURCETYPE, GROUPID, @@ -68,34 +61,43 @@ public: enum TYPE { TTEXT=TEXT, TQUICKHELPTEXT=QUICKHELPTEXT, TTITLE=TITLE }; private: + GenPoEntry m_aGenPo; OString m_sSourceFile; OString m_sGroupId; OString m_sLocalId; OString m_sResourceType; TYPE m_eType; OString m_sHelpText; - public: - PoEntry(); - PoEntry(const OString& i_rSDFLine, - const TYPE eType = TTEXT); - virtual ~PoEntry(); - - virtual OString getUnTransStr() const; - virtual OString getTransStr() const; - virtual void setUnTransStr(const OString& rUnTransStr); - virtual void setTransStr(const OString& rTransStr); - - virtual void writeToFile(std::ofstream& rOFStream); - virtual void readFromFile(std::ifstream& rIFStream); + PoEntry(); + PoEntry(const OString& i_rSDFLine, + const TYPE eType = TTEXT); + virtual ~PoEntry(); + + OString getSourceFile() const { return m_sSourceFile; } + OString getGroupId() const { return m_sGroupId; } + OString getLocalId() const { return m_sLocalId; } + OString getResourceType() const { return m_sResourceType; } + TYPE getType() const { return m_eType; } + OString getHelpText() const { return m_sHelpText; } + OString getUnTransStr() const; + OString getTransStr() const; + bool getFuzzy() const { return m_aGenPo.getFuzzy(); } + void setUnTransStr(const OString& rUnTransStr); + void setTransStr(const OString& rTransStr); + void setFuzzy(const bool bFuzzy); + + void writeToFile(std::ofstream& rOFStream); + void readFromFile(std::ifstream& rIFStream); }; -class PoHeader: public GenPoEntry +class PoHeader { private: + GenPoEntry m_aGenPo; OString m_sExtractionSource; OString m_sProjectIdVersion; OString m_sReportMsgidBugsTo; @@ -114,6 +116,7 @@ private: public: PoHeader( const OString& rExtSrc ); ~PoHeader(); + void writeToFile(std::ofstream& rOFStream); }; #endif // _PO_INCLUDED |