/* */ #include "XmlRpcRequestParserController.h" #include namespace aria2 { namespace rpc { void XmlRpcRequestParserController::pushFrame() { frameStack_.push(currentFrame_); currentFrame_ = StateFrame(); } void XmlRpcRequestParserController::popStructFrame() { assert(!frameStack_.empty()); StateFrame parentFrame = frameStack_.top(); Dict* dict = downcast(parentFrame.value_); assert(dict); frameStack_.pop(); if(currentFrame_.validMember()) { dict->put(currentFrame_.name_, currentFrame_.value_); } currentFrame_ = parentFrame; } void XmlRpcRequestParserController::popArrayFrame() { assert(!frameStack_.empty()); StateFrame parentFrame = frameStack_.top(); List* list = downcast(parentFrame.value_); assert(list); frameStack_.pop(); if(currentFrame_.value_) { list->append(currentFrame_.value_); } currentFrame_ = parentFrame; } void XmlRpcRequestParserController::setCurrentFrameValue (const SharedHandle& value) { currentFrame_.value_ = value; } void XmlRpcRequestParserController::setCurrentFrameName (const std::string& name) { currentFrame_.name_ = name; } const SharedHandle& XmlRpcRequestParserController::getCurrentFrameValue() const { return currentFrame_.value_; } } // namespace rpc } // namespace aria2