/* */ #ifndef D_XML_RPC_REQUEST_PARSER_CONTROLLER_H #define D_XML_RPC_REQUEST_PARSER_CONTROLLER_H #include "common.h" #include #include #include "ValueBase.h" namespace aria2 { namespace rpc { class XmlRpcRequestParserController { private: struct StateFrame { SharedHandle value_; std::string name_; bool validMember() const { return value_ && !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 SharedHandle& value); void setCurrentFrameName(const std::string& name); const SharedHandle& getCurrentFrameValue() const; void setMethodName(const std::string& methodName) { methodName_ = methodName; } const std::string& getMethodName() const { return methodName_; } }; } // namespace rpc } // namespace aria2 #endif // D_XML_RPC_REQUEST_PARSER_CONTROLLER_H