|
WSF
|
#include <Utml.hpp>
Public Types | |
| typedef std::map< std::string, UtmlObject > | PropertyMap |
Public Member Functions | |
| UtmlObject () | |
| UtmlObject (const std::string &aValue) | |
| UtmlObject (const UtmlObject &aRhs) | |
| UtmlObject & | operator= (const UtmlObject &aRhs) |
| ~UtmlObject () | |
| bool | IsValue () const |
| bool | IsContainer () const |
| const std::string & | GetValue () const |
| To be used when IsContainer() is false, the value as a string. | |
| void | SetValue (const std::string &aValue) |
| Assign the value. Not valid for containers. | |
| void | SetValueLines (const std::vector< std::string > &aLines) |
| std::vector< std::string > | GetValueLines () const |
| Multi-line values are allowed. This is a helper method to parse multiple lines, trimming whitespace. | |
| bool | GetBoolValue () const |
| void | SetBoolValue (bool aValue) |
| const std::string & | GetType () const |
| } | |
| std::map< std::string, UtmlObject > & | GetProperties () |
| Returns the list of properties on the object. | |
| const std::map< std::string, UtmlObject > & | GetProperties () const |
| Returns the list of properties on the object. | |
| UtmlObject * | FindProperty (const std::string &aName) const |
| Returns the named property if it exists. | |
| std::string | PropertyValue (const std::string &aPropertyName, const std::string &aDefaultValue) const |
| bool | Contains (const std::string &aPropertyName) const |
| Returns 'true' if the property by this name exists on this object. | |
| UtmlObject & | operator[] (const std::string &aName) |
| UtmlObject & | operator+= (const UtmlObject &aRhs) |
| Add a sub-object to this object. | |
| int | GetObjectCount () const |
| Returns the number of objects in the container. | |
| UtmlObject & | GetObject (int aIndex) |
| returns the object at the specified index | |
| const UtmlObject & | GetObject (int aIndex) const |
| returns the object at the specified index | |
| UtmlObject * | FirstObjectByType (const std::string &aTypeName) const |
| void | GiveProperty (const std::string &aName, UtmlObject &aObject) |
| Consumes aObject and adds the object as a named property of this container. | |
| void | GiveObject (UtmlObject &aObject) |
| Consumes aObject and adds the object as a sub-object. | |
| void | Swap (UtmlObject &aRhs) |
| } | |
| std::string | ToText () const |
| bool | operator== (const UtmlObject &aRhs) const |
| bool | operator!= (const UtmlObject &aRhs) const |
Static Public Member Functions | |
| static UtmlObject | makeContainer (const std::string &aType) |
| Returns a container object of the specified type. | |
| static UtmlObject | parse (const std::string &aContainerType, const std::string &aText) |
| Parse a string and return it as a Utml container. | |
| static UtmlObject | parseFile (const std::string &aFilePath) |
| Parse a file and return it as a Utml container. | |
| typedef std::map<std::string, UtmlObject> UtmlObject::PropertyMap |
|
inline |
Referenced by FindProperty(), FirstObjectByType(), GetObject(), GiveObject(), GiveProperty(), makeContainer(), operator!=(), operator+=(), operator=(), operator==(), operator[](), parse(), parseFile(), PropertyValue(), Swap(), and UtmlObject().
| UtmlObject::UtmlObject | ( | const std::string & | aValue | ) |
| UtmlObject::UtmlObject | ( | const UtmlObject & | aRhs | ) |
References UtmlObject().
| UtmlObject::~UtmlObject | ( | ) |
| bool UtmlObject::Contains | ( | const std::string & | aPropertyName | ) | const |
Returns 'true' if the property by this name exists on this object.
| UtmlObject * UtmlObject::FindProperty | ( | const std::string & | aName | ) | const |
Returns the named property if it exists.
References UtmlObject().
Referenced by WsfEventPipeInterface::AddedToSimulation(), and PropertyValue().
| UtmlObject * UtmlObject::FirstObjectByType | ( | const std::string & | aTypeName | ) | const |
Returns a pointer to the first object with the specified type. Returns 'null' if none exist.
References UtmlObject().
| bool UtmlObject::GetBoolValue | ( | ) | const |
|
inline |
returns the object at the specified index
References GetObjectCount().
Referenced by WsfEventPipeInterface::AddedToSimulation(), UtPackEnumType::Read(), UtPackSchema::Read(), UtPackStruct::Read(), UtPackUnion::Read(), UtPackType::ReadNestedTypes(), wizard::ToolPrefData::ToolPrefData(), and UtmlWriter::WriteRoot().
|
inline |
returns the object at the specified index
References GetObjectCount(), and UtmlObject().
|
inline |
Returns the number of objects in the container.
Referenced by WsfEventPipeInterface::AddedToSimulation(), GetObject(), GetObject(), UtPackEnumType::Read(), UtPackSchema::Read(), UtPackStruct::Read(), UtPackUnion::Read(), UtPackType::ReadNestedTypes(), wizard::ToolPrefData::ToolPrefData(), and UtmlWriter::WriteRoot().
|
inline |
Returns the list of properties on the object.
Referenced by GiveProperty(), and operator[]().
|
inline |
Returns the list of properties on the object.
|
inline |
}
Container methods These methods are for operating on container objects. To be called only if IsContainer() is true. { Returns the type name of the object
References IsContainer().
Referenced by WsfEventPipeInterface::AddedToSimulation(), UtPackEnumType::Read(), UtPackSchema::Read(), UtPackStruct::Read(), UtPackUnion::Read(), UtPackSchema::ReadType(), and wizard::ToolPrefData::ToolPrefData().
|
inline |
To be used when IsContainer() is false, the value as a string.
References IsContainer().
Referenced by PropertyValue(), UtPackBasicType::Read(), UtPackField::Read(), UtPackType::Read(), and ToText().
| std::vector< std::string > UtmlObject::GetValueLines | ( | ) | const |
Multi-line values are allowed. This is a helper method to parse multiple lines, trimming whitespace.
| void UtmlObject::GiveObject | ( | UtmlObject & | aObject | ) |
Consumes aObject and adds the object as a sub-object.
References Swap(), and UtmlObject().
| void UtmlObject::GiveProperty | ( | const std::string & | aName, |
| UtmlObject & | aObject ) |
Consumes aObject and adds the object as a named property of this container.
References GetProperties(), Swap(), and UtmlObject().
|
inline |
An object can either be a container or a simple value. Returns 'true' if this is a container
Referenced by GetType(), GetValue(), operator+=(), UtmlParser::Parse(), and SetValue().
|
inline |
An object can either be a container or a simple value. Returns 'true' if this is a simple value
Referenced by ToText().
|
static |
Returns a container object of the specified type.
References UtmlObject().
Referenced by WsfEventPipeInterface::AddedToSimulation(), parse(), parseFile(), and wizard::ToolPrefData::ToolPrefData().
|
inline |
References operator==(), and UtmlObject().
|
inline |
Add a sub-object to this object.
References IsContainer(), and UtmlObject().
| UtmlObject & UtmlObject::operator= | ( | const UtmlObject & | aRhs | ) |
References UtmlObject().
| bool UtmlObject::operator== | ( | const UtmlObject & | aRhs | ) | const |
References UtmlObject().
| UtmlObject & UtmlObject::operator[] | ( | const std::string & | aName | ) |
Return a property if it exists. If the property does not exist, create a new property with an empty value
References GetProperties(), and UtmlObject().
|
static |
Parse a string and return it as a Utml container.
References makeContainer(), UtmlParser::Parse(), and UtmlObject().
|
static |
Parse a file and return it as a Utml container.
References makeContainer(), UtmlParser::Parse(), UtmlObject(), and UtmlParseError::what().
| std::string UtmlObject::PropertyValue | ( | const std::string & | aPropertyName, |
| const std::string & | aDefaultValue ) const |
If the name property exists and is a simple value, returns the value as a string. otherwise, aDefaultValue is returned.
References FindProperty(), GetValue(), and UtmlObject().
Referenced by WsfEventPipeInterface::AddedToSimulation(), UtPackBasicType::Read(), UtPackEnumType::Read(), UtPackField::Read(), UtPackListType::Read(), UtPackSchema::Read(), UtPackStruct::Read(), and wizard::ToolPrefData::ToolPrefData().
| void UtmlObject::SetBoolValue | ( | bool | aValue | ) |
|
inline |
Assign the value. Not valid for containers.
References IsContainer().
Referenced by WsfEventPipeInterface::AddedToSimulation().
| void UtmlObject::SetValueLines | ( | const std::vector< std::string > & | aLines | ) |
{ Standard-value processing values are free-form, but these helper methods are provided to read specific value formats Multi-line values are allowed. This is a helper method to assign a multi-line value
|
inline |
}
Swaps the value of two objects in constant time
References std::swap(), and UtmlObject().
Referenced by GiveObject(), and GiveProperty().
| std::string UtmlObject::ToText | ( | ) | const |
References GetValue(), IsValue(), UtmlWriter::mIndent, and UtmlWriter::WriteRoot().