/* */ #ifndef _D_XML_RPC_REQUEST_PARSER_CONTROLLER_H_ #define _D_XML_RPC_REQUEST_PARSER_CONTROLLER_H_ #include "common.h" #include #include #include "BDE.h" namespace aria2 { namespace xmlrpc { class XmlRpcRequestParserController { private: struct StateFrame { BDE _value; std::string _name; bool validMember() const { return !_value.isNone() && !_name.empty(); } }; std::stack _frameStack; StateFrame _currentFrame; std::string _methodName; public: void pushFrame(); // Pops StateFrame p from _frameStack and set p[_currentFrame._name] // = _currentFrame._value and _currentFrame = p; void popStructFrame(); // Pops StateFrame p from _frameStack and add _currentFrame._value // to p and _currentFrame = p; void popArrayFrame(); void setCurrentFrameValue(const BDE& value) { _currentFrame._value = value; } void setCurrentFrameName(const std::string& name) { _currentFrame._name = name; } const BDE& getCurrentFrameValue() const { return _currentFrame._value; } void setMethodName(const std::string& methodName) { _methodName = methodName; } const std::string& getMethodName() const { return _methodName; } }; } // namespace xmlrpc } // namespace aria2 #endif // _D_XML_RPC_REQUEST_PARSER_CONTROLLER_H_