Smithy Qt 0.1.0-pre
Internal development documentation
|
The ShapeId class provides a Qt representation of a Smithy Shape ID. More...
Public Member Functions | |
ShapeId () | |
Constructs an empty ShapeId object. | |
ShapeId (ShapeId &&other) | |
Constructs a ShapeId object by moving resources from other. | |
ShapeId (const ShapeId &other) | |
Constructs a ShapeId object by copying other. | |
ShapeId (const QString &shapeId) | |
Constructs a ShapeId object by parsing the Smithy Shape ID given by shapeId. | |
ShapeId & | operator= (const ShapeId &shapeId) |
Assigns the specified shapeId to this object. | |
ShapeId & | operator= (const ShapeId &&shapeId) |
Moves the specified shapeId to this object. | |
ShapeId & | operator= (const QString &shapeId) |
Assigns the specified shapeId to this object. | |
~ShapeId () | |
Destroys this ShapeId object. | |
QString | memberName () const |
Returns the Shape ID's member name, if it has one, otherwise a null string. | |
QString | nameSpace () const |
Returns the Shape ID's namespace, if it has one, otherwise a null string. | |
QString | shapeName () const |
Returns the Shape ID's shape name, if it has one, otherwise a null string. | |
void | setMemberName (const QString &name) |
Set the Shape ID's member name to name, which may be an empty or null string. | |
void | setNameSpace (const QString &name) |
Set the Shape ID's namespace to name, which may be an empty or null string. | |
void | setShapeName (const QString &name) |
Set the Shape ID's shape name to name. | |
QString | absoluteShapeId () const |
Returns this object as an absolute Smithy Shape ID if this object has a namespace, otherwise a null string. | |
QString | relativeShapeId () const |
Returns this object as a relative Smithy Shape ID, that one without a leading namespace. | |
QString | toString () const |
Returns this object as an absolute Smithy Shape ID if this object has a namespace, otherwise a relative Smithy Shape ID. | |
bool | hasNameSpace () const |
Returns true if this Shape ID has a non-empty namespace, otherwise false otherwise. | |
bool | hasMemberName () const |
Returns true if this Shape ID has a non-empty member name, otherwise false otherwise. | |
bool | isAbsoluteRootShapeId () const |
Returns true if this Shape ID is a root Shape ID, and has a namespace, false otherwise. | |
bool | isRootShapeId () const |
Returns true if this Shape ID is a root Shape ID, false otherwise. | |
bool | isRelativeShapeId () const |
Returns true if this Shape ID is a relative Shape ID, false otherwise. | |
bool | isValid () const |
Returns true if this object represents a valid, non-empty Smithy Shape ID. | |
bool | operator== (const ShapeId &other) const |
Private Member Functions | |
Q_DECLARE_TR_FUNCTIONS (ShapeId) | |
Private Attributes | |
ShapeIdPrivate * | d_ptr |
ShapeId::ShapeId | ( | ) |
Constructs an empty ShapeId object.
Definition at line 27 of file shapeid.cpp.
References d_ptr.
Referenced by isValid(), memberName(), nameSpace(), operator=(), operator=(), operator=(), setMemberName(), setNameSpace(), setShapeName(), ShapeId(), ShapeId(), ShapeId(), and shapeName().
ShapeId::ShapeId | ( | ShapeId && | other | ) |
Constructs a ShapeId object by moving resources from other.
Definition at line 35 of file shapeid.cpp.
References d_ptr, and ShapeId().
ShapeId::ShapeId | ( | const ShapeId & | other | ) |
Constructs a ShapeId object by copying other.
Definition at line 46 of file shapeid.cpp.
References d_ptr, and ShapeId().
ShapeId::ShapeId | ( | const QString & | shapeId | ) |
Constructs a ShapeId object by parsing the Smithy Shape ID given by shapeId.
To be considered valid, shapeId must contain at least a valid shape name, but may also contain optional namespace and member name components. Use isValid() to verify shapeId's validity.
Definition at line 63 of file shapeid.cpp.
References d_ptr, and ShapeId().
ShapeId::~ShapeId | ( | ) |
QString ShapeId::absoluteShapeId | ( | ) | const |
Returns this object as an absolute Smithy Shape ID if this object has a namespace, otherwise a null string.
false
) it still safe to invoke this method, but the result is undefined.Definition at line 185 of file shapeid.cpp.
References hasNameSpace(), nameSpace(), and relativeShapeId().
Referenced by toString().
bool ShapeId::hasMemberName | ( | ) | const |
Returns true
if this Shape ID has a non-empty member name, otherwise false
otherwise.
Definition at line 236 of file shapeid.cpp.
References memberName().
Referenced by isRootShapeId(), and relativeShapeId().
bool ShapeId::hasNameSpace | ( | ) | const |
Returns true
if this Shape ID has a non-empty namespace, otherwise false
otherwise.
Definition at line 225 of file shapeid.cpp.
References nameSpace().
Referenced by absoluteShapeId(), Model::insert(), isAbsoluteRootShapeId(), isRelativeShapeId(), and toString().
bool ShapeId::isAbsoluteRootShapeId | ( | ) | const |
Returns true
if this Shape ID is a root Shape ID, and has a namespace, false
otherwise.
Definition at line 247 of file shapeid.cpp.
References hasNameSpace(), and isRootShapeId().
bool ShapeId::isRelativeShapeId | ( | ) | const |
Returns true
if this Shape ID is a relative Shape ID, false
otherwise.
Definition at line 271 of file shapeid.cpp.
References hasNameSpace().
bool ShapeId::isRootShapeId | ( | ) | const |
Returns true
if this Shape ID is a root Shape ID, false
otherwise.
Definition at line 259 of file shapeid.cpp.
References hasMemberName().
Referenced by isAbsoluteRootShapeId().
bool ShapeId::isValid | ( | ) | const |
Returns true if this object represents a valid, non-empty Smithy Shape ID.
Definition at line 281 of file shapeid.cpp.
References ShapeId().
Referenced by Model::insert().
QString ShapeId::memberName | ( | ) | const |
Returns the Shape ID's member name, if it has one, otherwise a null string.
Definition at line 114 of file shapeid.cpp.
References ShapeId().
Referenced by hasMemberName(), and relativeShapeId().
QString ShapeId::nameSpace | ( | ) | const |
Returns the Shape ID's namespace, if it has one, otherwise a null string.
Definition at line 123 of file shapeid.cpp.
References ShapeId().
Referenced by absoluteShapeId(), and hasNameSpace().
ShapeId & ShapeId::operator= | ( | const QString & | shapeId | ) |
Assigns the specified shapeId to this object.
Definition at line 96 of file shapeid.cpp.
References ShapeId().
Moves the specified shapeId to this object.
Definition at line 84 of file shapeid.cpp.
References ShapeId().
Assigns the specified shapeId to this object.
Definition at line 72 of file shapeid.cpp.
References d_ptr, and ShapeId().
bool ShapeId::operator== | ( | const ShapeId & | other | ) | const |
QString ShapeId::relativeShapeId | ( | ) | const |
Returns this object as a relative Smithy Shape ID, that one without a leading namespace.
false
) it still safe to invoke this method, but the result is undefined.Definition at line 198 of file shapeid.cpp.
References hasMemberName(), memberName(), and shapeName().
Referenced by absoluteShapeId(), and toString().
void ShapeId::setMemberName | ( | const QString & | name | ) |
Set the Shape ID's member name to name, which may be an empty or null string.
Definition at line 145 of file shapeid.cpp.
References ShapeId().
void ShapeId::setNameSpace | ( | const QString & | name | ) |
Set the Shape ID's namespace to name, which may be an empty or null string.
Definition at line 154 of file shapeid.cpp.
References ShapeId().
void ShapeId::setShapeName | ( | const QString & | name | ) |
Set the Shape ID's shape name to name.
Note, a Shape ID is considered invalid if it has no shape name, so name should typically be non-empty.
Definition at line 166 of file shapeid.cpp.
References ShapeId().
QString ShapeId::shapeName | ( | ) | const |
Returns the Shape ID's shape name, if it has one, otherwise a null string.
Note, a Shape ID is considered invalid if it has no shape name.
Definition at line 136 of file shapeid.cpp.
References ShapeId().
Referenced by relativeShapeId().
QString ShapeId::toString | ( | ) | const |
Returns this object as an absolute Smithy Shape ID if this object has a namespace, otherwise a relative Smithy Shape ID.
false
) it still safe to invoke this method, but the result is undefined.Definition at line 214 of file shapeid.cpp.
References absoluteShapeId(), hasNameSpace(), and relativeShapeId().
Referenced by Model::insert().
|
private |
Internal d-pointer.
Definition at line 65 of file shapeid.h.
Referenced by operator=(), ShapeId(), ShapeId(), ShapeId(), ShapeId(), and ~ShapeId().