WireDecoder: Add overloads for StringValue and Value.

Change-Id: Idb41fd16fec8efc8b984c1a9b4d225829d16e344
StringValue: Add comparison operators.
This commit is contained in:
Peter Johnson
2015-07-04 23:10:59 -07:00
parent a55b6565b8
commit 6aa32e8752
3 changed files with 36 additions and 3 deletions

View File

@@ -13,6 +13,7 @@
#include "ntcore.h"
#include "leb128.h"
#include "raw_istream.h"
#include "Value.h"
namespace ntimpl {
@@ -101,6 +102,15 @@ class WireDecoder {
bool ReadValue(NT_Type type, NT_Value* value);
bool ReadString(NT_String* str);
bool ReadValue(NT_Type type, Value* value) {
NT_DisposeValue(value);
return ReadValue(type, static_cast<NT_Value*>(value));
}
bool ReadString(StringValue* str) {
NT_DisposeString(str);
return ReadString(static_cast<NT_String*>(str));
}
WireDecoder(const WireDecoder&) = delete;
WireDecoder& operator=(const WireDecoder&) = delete;