1
0
Fork 0

updated vpack library

This commit is contained in:
Jan Steemann 2015-12-09 11:50:55 +01:00
parent 852edf2f83
commit d8463ae70a
4 changed files with 7 additions and 5 deletions

View File

@ -102,8 +102,7 @@ class Buffer {
inline ValueLength length() const { return _pos; }
std::string toString() const {
std::string result(reinterpret_cast<char const*>(_buffer), _pos);
return std::move(result);
return std::string(reinterpret_cast<char const*>(_buffer), _pos);
}
void clear() { reset(); }

View File

@ -89,7 +89,7 @@ class Dumper {
static std::string toString(Slice const* slice,
Options const* options = &Options::Defaults) {
return std::move(toString(*slice, options));
return toString(*slice, options);
}
void append(Slice const& slice) { dumpValue(&slice); }

View File

@ -34,9 +34,12 @@
using namespace arangodb::velocypack;
std::string Builder::toString() const {
Options options;
options.prettyPrint = true;
std::string buffer;
StringSink sink(&buffer);
Dumper::dump(slice(), &sink, options);
Dumper::dump(slice(), &sink, &options);
return std::move(buffer);
}

View File

@ -273,7 +273,7 @@ std::string Slice::toString() const {
return std::move(buffer);
}
std::string Slice::hexType() const { return std::move(HexDump::toHex(head())); }
std::string Slice::hexType() const { return HexDump::toHex(head()); }
// look for the specified attribute inside an Object
// returns a Slice(ValueType::None) if not found