#ifndef __INC_SCRIPT_PARSER_H__ #define __INC_SCRIPT_PARSER_H__ #include #include namespace script { typedef struct SArgumet { SArgumet(const std::string& c_stName, const std::string& c_stValue) { strName = c_stName; strValue = c_stValue; } SArgumet(const SArgumet& c_arg) { strName = c_arg.strName; strValue = c_arg.strValue; } void operator=(const SArgumet& c_arg) { strName = c_arg.strName; strValue = c_arg.strValue; } std::string strName; std::string strValue; } TArg; typedef std::list TArgList; typedef struct SCmd { std::string name; TArgList argList; SCmd() {} SCmd(const SCmd& c_cmd) { name = c_cmd.name; argList = c_cmd.argList; } void operator=(const SCmd& c_cmd) { name = c_cmd.name; argList = c_cmd.argList; } } TCmd; class Group { public: Group(); ~Group(); public: /** ½ºÆ®¸µÀ¸·Î ºÎÅÍ ½ºÅ©¸³Æ® ±×·ìÀ» ¸¸µç´Ù. * * ½ÇÆÐÇϸé GetError ¸Þ¼Òµå·Î È®ÀÎÇÒ ¼ö ÀÖ´Ù. * * @param stSource ÀÌ ½ºÆ®¸µÀ¸·Î ºÎÅÍ ±×·ìÀÌ ¸¸µé¾î Áø´Ù. * @return ¼º°ø½Ã true, ½ÇÆÐÇϸé false */ bool Create(const std::string & stSource); /** ¸í·É¾î¸¦ ¹Þ´Â ¸Þ¼Òµå * * @param cmd ¼º°ø½Ã¿¡ ÀÌ ±¸Á¶Ã¼·Î ¸í·É¾î°¡ º¹»ç µÈ´Ù. * @return ¸í·É¾î°¡ ³²¾Æ ÀÖ´Ù¸é true, ¾ø´Ù¸é false */ bool GetCmd(TCmd & cmd); /* ¸í·É¾î¸¦ °¡Á®¿ÀµÇ ²¨³»Áö´Â ¾Ê´Â´Ù. */ bool ReadCmd(TCmd & cmd); /** ¿¡·¯¸¦ Ãâ·Â ¹Þ´Â ¸Þ¼Òµå * * @return stError ÀÌ °÷À¸·Î ¿¡·¯°¡ Ãâ·Â µÈ´Ù. */ std::string & GetError(); private: void SetError(const char *str); bool GetArg(const char * c_atr_base, int arg_len, TArgList & argList); std::string m_stError; std::list m_cmdList; }; } #endif