mirror of https://gitee.com/bigwinds/arangodb
Added a bodyToVelocyPack function for Simple Http Result
This commit is contained in:
parent
b8a9efbe33
commit
de588621bc
|
@ -31,6 +31,9 @@
|
|||
#include "SimpleHttpResult.h"
|
||||
#include "Basics/StringUtils.h"
|
||||
|
||||
#include <velocypack/Parser.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
using namespace triagens::basics;
|
||||
using namespace std;
|
||||
|
||||
|
@ -81,6 +84,12 @@ namespace triagens {
|
|||
return _resultBody;
|
||||
}
|
||||
|
||||
std::shared_ptr<VPackBuilder> SimpleHttpResult::getBodyVelocyPack (VPackOptions const& options) const {
|
||||
VPackParser parser(&options);
|
||||
parser.parse(_resultBody.c_str());
|
||||
return parser.steal();
|
||||
}
|
||||
|
||||
string SimpleHttpResult::getResultTypeMessage () const {
|
||||
switch (_requestResultType) {
|
||||
case (COMPLETE):
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
#include "Basics/Common.h"
|
||||
#include "Basics/StringBuffer.h"
|
||||
|
||||
#include <velocypack/Builder.h>
|
||||
#include <velocypack/Options.h>
|
||||
#include <velocypack/velocypack-aliases.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief class for storing a request result
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -159,6 +163,13 @@ namespace triagens {
|
|||
|
||||
triagens::basics::StringBuffer const& getBody () const;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns the http body as velocypack
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
std::shared_ptr<VPackBuilder> getBodyVelocyPack (VPackOptions const&) const;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns the request result type
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue