summaryrefslogtreecommitdiff
path: root/src/XmlRpcRequestParserController.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-06-19 17:54:54 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-06-19 17:54:54 +0000
commitcb4e25e4b4a2cfa6349a25586a44c932022e6841 (patch)
tree15c0713df0ca88784a0c95a466e3a846192f290b /src/XmlRpcRequestParserController.cc
parent8ba97188ce42be38b5427e9bd70bb7f5ba8238f9 (diff)
2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed BDE and bencode
Diffstat (limited to 'src/XmlRpcRequestParserController.cc')
-rw-r--r--src/XmlRpcRequestParserController.cc30
1 files changed, 25 insertions, 5 deletions
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<ValueBase>& value)
+{
+ _currentFrame._value = value;
+}
+
+void XmlRpcRequestParserController::setCurrentFrameName
+(const std::string& name)
+{
+ _currentFrame._name = name;
+}
+
+const SharedHandle<ValueBase>&
+XmlRpcRequestParserController::getCurrentFrameValue() const
+{
+ return _currentFrame._value;
+}
+
} // namespace xmlrpc
} // namespace aria2