Don't base Value on NT_Value.

Also use std::string instead of NT_String.

Conversions to/from the internal structures will be done at the interface.
This commit is contained in:
Peter Johnson
2015-07-16 01:38:27 -07:00
committed by Peter Johnson
parent 555725a05b
commit 9906116d23
17 changed files with 870 additions and 984 deletions

View File

@@ -102,17 +102,8 @@ class WireDecoder {
}
bool ReadType(NT_Type* type);
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));
}
bool ReadString(std::string* str);
std::shared_ptr<Value> ReadValue(NT_Type type);
WireDecoder(const WireDecoder&) = delete;
WireDecoder& operator=(const WireDecoder&) = delete;