Allow fields to be freely created for objects that aren't required to conform to a template.

This commit is contained in:
JoelKatz
2012-10-06 18:34:27 -07:00
parent 16fbd7a862
commit 34a3124c11
2 changed files with 25 additions and 16 deletions

View File

@@ -51,6 +51,7 @@ public:
bool setType(const std::vector<SOElement::ptr>& type);
bool isValidForType();
bool isFieldAllowed(SField::ref);
bool isFree() const { return mType.empty(); }
void set(const std::vector<SOElement::ptr>&);
bool set(SerializerIterator& u, int depth = 0);
@@ -95,7 +96,7 @@ public:
const SerializedType& peekAtField(SField::ref field) const;
SerializedType& getField(SField::ref field);
const SerializedType* peekAtPField(SField::ref field) const;
SerializedType* getPField(SField::ref field);
SerializedType* getPField(SField::ref field, bool createOkay = false);
// these throw if the field type doesn't match, or return default values if the
// field is optional but not present