#pragma once #include "Singleton.h" #include "StringUtil.h" #include class TiXmlElement; class CStream; class CEtUIXML : public CSingleton { public: enum emCategoryId { idCategory1 = 1, // Ŭ¶óÀÌ¾ðÆ® ¸Þ¼¼Áö idCategory2 = 2, // ¼­¹ö ¸Þ¼¼Áö }; public: CEtUIXML(void); virtual ~CEtUIXML(void); public: typedef std::map< int, std::wstring > XML_STRING_MAP; typedef XML_STRING_MAP::iterator XML_STRING_MAP_ITER; struct TNationString { XML_STRING_MAP mapCategory1; XML_STRING_MAP mapCategory2; TNationString() { mapCategory1.clear(); mapCategory2.clear(); } }; typedef std::map< int, TNationString > XML_NATIONSTRING_MAP; typedef XML_NATIONSTRING_MAP::iterator XML_NATIONSTRING_MAP_IT; protected: XML_STRING_MAP m_mapCategory1; XML_STRING_MAP m_mapCategory2; XML_NATIONSTRING_MAP m_mapNationString; std::map m_mapStringCategory1; int m_nCurCategoryId; int m_nCurMessageId; int m_nCurNationId; protected: /*void ParsingCategory( TiXmlElement *pElement );*/ void ParsingMessage( TiXmlElement *pElement ); void ParsingLang( TiXmlElement *pElement ); const char* GetLangId( UINT nCodePage ); public: const XML_STRING_MAP* GetCategoryList( emCategoryId categoryId ); const wchar_t* GetUIString( emCategoryId categoryId, int nMessageId, int nNationId = -1 ); bool CheckKoreanWord( const wchar_t *szString ); int GetUIMessageID(const WCHAR * pwszString); // ±¹°¡º° µðÆÄÀÎüũ¸¦ EtStringManager¿¡¼­ ÇÒ ¼ö ¾øÀ¸´Ï ¿ÜºÎ¿¡¼­ ¼³Á¤Çϵµ·Ï ÇÑ´Ù. // ±âº»°ª(±¹³»ºôµå)Àº falseÀ̸ç, ±× ¿Ü ¹öÀü¿¡¼­´Â true·Î Çѱ۳ª¿À¸é M : ID·Î ¹Ù²ã¹ö¸°´Ù. static bool s_bCheckKoreanWord; public: bool LoadXML( const char *szFileName, emCategoryId categoryId ); bool Initialize( CStream *pStream, emCategoryId categoryId ); bool Initialize( CStream *pStream, emCategoryId categoryId, int nNationId, bool bAttachData = false ); //////////////////////////////////////////////////////////////////////////////// protected: std::vector m_vecAccountFilter; std::vector m_vecChatFilter; std::vector m_vecWhiteList; std::vector m_vecReplaceFilter; protected: void ParsingAccountWord( TiXmlElement *pElement ); void ParsingChatWord( TiXmlElement *pElement ); void ParsingWhiteListWord( TiXmlElement *pElement ); void ParsingReplaceWord( TiXmlElement *pElement ); public: bool LoadFilter( const char *szFileName ); bool LoadWhiteList( const char *szFileName ); std::vector &GetAccountFilter() { return m_vecAccountFilter; } std::vector &GetChatFilter() { return m_vecChatFilter; } std::vector &GetWhiteList() { return m_vecWhiteList; } std::vector &GetReplaceFilter() { return m_vecReplaceFilter; } private: //nation XML_STRING_MAP * _GetCategoryNationString(int nCategoryId, int nNationId = -1); }; #define GetEtUIXML() CEtUIXML::GetInstance() // ½ºÆ®¸µ Á¶ÇÕ ¹ø¿ª ¿¹¿Ü 󸮿¡ »ç¿ë ÇÒ xml class CEtExceptionalUIXML : public CSingleton { public: CEtExceptionalUIXML(); virtual ~CEtExceptionalUIXML(); public: bool LoadXML( const char* szFileName ); bool Initialize( CStream* pStream ); void ParsingMessage( TiXmlElement *pElement ); std::wstring GetReplacementUIString( char* szParam ); protected: std::map< std::wstring, std::wstring > m_mapReplacementString; }; #define GetEtExeptionalUIXML() CEtExceptionalUIXML::GetInstance()