From cb4e25e4b4a2cfa6349a25586a44c932022e6841 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 19 Jun 2010 17:54:54 +0000 Subject: 2010-06-20 Tatsuhiro Tsujikawa Removed BDE and bencode --- src/XmlRpcRequestParserController.cc | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/XmlRpcRequestParserController.cc') diff --git a/src/XmlRpcRequestParserController.cc b/src/XmlRpcRequestParserController.cc index 71f578df..30a31155 100644 --- a/src/XmlRpcRequestParserController.cc +++ b/src/XmlRpcRequestParserController.cc @@ -51,10 +51,11 @@ void XmlRpcRequestParserController::popStructFrame() assert(!_frameStack.empty()); StateFrame parentFrame = _frameStack.top(); - assert(parentFrame._value.isDict()); + Dict* dict = asDict(parentFrame._value); + assert(dict); _frameStack.pop(); if(_currentFrame.validMember()) { - parentFrame._value[_currentFrame._name] = _currentFrame._value; + dict->put(_currentFrame._name, _currentFrame._value); } _currentFrame = parentFrame; } @@ -64,14 +65,33 @@ void XmlRpcRequestParserController::popArrayFrame() assert(!_frameStack.empty()); StateFrame parentFrame = _frameStack.top(); - assert(parentFrame._value.isList()); + List* list = asList(parentFrame._value); + assert(list); _frameStack.pop(); - if(!_currentFrame._value.isNone()) { - parentFrame._value << _currentFrame._value; + if(!_currentFrame._value.isNull()) { + 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 xmlrpc } // namespace aria2 -- cgit