Index: src/rc2lng/rc.h =================================================================== diff -u -N -r4eceec553f29c0ba93452ffeb52a647204dc9fce -r8443d0d98d380facaf07b540c8d98da08365b816 --- src/rc2lng/rc.h (.../rc.h) (revision 4eceec553f29c0ba93452ffeb52a647204dc9fce) +++ src/rc2lng/rc.h (.../rc.h) (revision 8443d0d98d380facaf07b540c8d98da08365b816) @@ -1,74 +1,74 @@ -/*************************************************************************** -* Copyright (C) 2001-2008 by J�zef Starosczyk * -* ixen@copyhandler.com * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU Library General Public License * -* (version 2) as published by the Free Software Foundation; * -* * -* This program is distributed in the hope that it will be useful, * -* but WITHOUT ANY WARRANTY; without even the implied warranty of * -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -* GNU General Public License for more details. * -* * -* You should have received a copy of the GNU Library General Public * -* License along with this program; if not, write to the * -* Free Software Foundation, Inc., * -* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * -***************************************************************************/ -#ifndef __RC_H__ -#define __RC_H__ - -class CRCFile -{ -private: - typedef std::map element_map; - typedef std::map group_map; - - enum ELineType - { - eLine_Group, - eLine_Translation - }; -public: - CRCFile(); - ~CRCFile(); - - void ReadRC(PCTSTR pszFilename); - void ReadResourceIDs(PCTSTR pszFilename); - - void WriteRC(PCTSTR pszFilename); - void WriteLang(PCTSTR pszFilename, PCTSTR pszHeaderFile); - - void Clear(); - -protected: - // Adds initial values to the maps - void AddInitialValues(); - - static int GetCommasCount(const CString& str); - - static void WriteFile(PCTSTR pszFile, const std::vector& rLines, bool bUnicode); - static void ReadFile(PCTSTR pszFile, std::vector& rLines, bool bUnicode); - - void AddTranslationLine(ELineType eLineType, UINT uiID, PCTSTR pszText, std::vector& vLines); - - bool ProcessRCFile(); - void ProcessMenu(UINT uiMenuID, std::vector::iterator *init); - void ProcessDialog(UINT uiDialogID, std::vector::iterator *init); - void ProcessStringTable(UINT uiStringGroupID, std::vector::iterator *init); - - element_map* GetElementMap(UINT uiGroup); - UINT GetResourceID(PCTSTR pszID); - -protected: - std::map m_mapNameToID; // resource name to resource id - std::vector m_vInRCFile; // lines from rc file - std::vector m_vOutRCFile; // lines to write to rc file - - group_map m_mapOutputLanguage; // section_id->element_id->string -// std::vector m_vOutputLanguage; // lines of the language file to be written - TCHAR* m_pszBuffer; -}; - -#endif +/*************************************************************************** +* Copyright (C) 2001-2008 by J�zef Starosczyk * +* ixen@copyhandler.com * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU Library General Public License * +* (version 2) as published by the Free Software Foundation; * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU Library General Public * +* License along with this program; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#ifndef __RC_H__ +#define __RC_H__ + +class CRCFile +{ +private: + typedef std::map element_map; + typedef std::map group_map; + + enum ELineType + { + eLine_Group, + eLine_Translation + }; +public: + CRCFile(); + ~CRCFile(); + + void ReadRC(PCTSTR pszFilename); + void ReadResourceIDs(PCTSTR pszFilename); + + void WriteRC(PCTSTR pszFilename); + void WriteLang(PCTSTR pszFilename, PCTSTR pszHeaderFile); + + void Clear(); + +protected: + // Adds initial values to the maps + void AddInitialValues(); + + static int GetCommasCount(const CString& str); + + static void WriteFile(PCTSTR pszFile, const std::vector& rLines, bool bUnicode); + static void ReadFile(PCTSTR pszFile, std::vector& rLines, bool bUnicode); + + void AddTranslationLine(ELineType eLineType, UINT uiID, PCTSTR pszText, std::vector& vLines); + + bool ProcessRCFile(); + void ProcessMenu(UINT uiMenuID, std::vector::iterator *init); + void ProcessDialog(UINT uiDialogID, std::vector::iterator *init); + void ProcessStringTable(UINT uiStringGroupID, std::vector::iterator *init); + + element_map* GetElementMap(UINT uiGroup); + UINT GetResourceID(PCTSTR pszID); + +protected: + std::map m_mapNameToID; // resource name to resource id + std::vector m_vInRCFile; // lines from rc file + std::vector m_vOutRCFile; // lines to write to rc file + + group_map m_mapOutputLanguage; // section_id->element_id->string +// std::vector m_vOutputLanguage; // lines of the language file to be written + TCHAR* m_pszBuffer; +}; + +#endif