Smithy Qt 0.1.0-pre
Smithy code generator for Qt
Loading...
Searching...
No Matches
ShapeId Class Reference

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.
 
ShapeIdoperator= (const ShapeId &shapeId)
 Assigns the specified shapeId to this object.
 
ShapeIdoperator= (const ShapeId &&shapeId)
 Moves the specified shapeId to this object.
 
ShapeIdoperator= (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
 

Detailed Description

The ShapeId class provides a Qt representation of a Smithy Shape ID.

See also
https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id

Constructor & Destructor Documentation

◆ 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.

See also
isValid
https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id
Here is the call graph for this function:

Member Function Documentation

◆ absoluteShapeId()

QString ShapeId::absoluteShapeId ( ) const

Returns this object as an absolute Smithy Shape ID if this object has a namespace, otherwise a null string.

Note
, Smithy defines an absolute Shape ID as one that begins with a namespace, therefore it is not possible to return an absolute Shape ID if no namespace has been set.
, if the Shape ID is invalid (ie isValid() returns false) it still safe to invoke this method, but the result is undefined.
See also
setNameSpace
isValid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasMemberName()

bool ShapeId::hasMemberName ( ) const

Returns true if this Shape ID has a non-empty member name, otherwise false otherwise.

See also
memberName.
setMemberName.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasNameSpace()

bool ShapeId::hasNameSpace ( ) const

Returns true if this Shape ID has a non-empty namespace, otherwise false otherwise.

See also
nameSpace.
setNameSpace.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isAbsoluteRootShapeId()

bool ShapeId::isAbsoluteRootShapeId ( ) const

Returns true if this Shape ID is a root Shape ID, and has a namespace, false otherwise.

See also
isRootShapeId.
hasNameSpace.
Here is the call graph for this function:

◆ isRelativeShapeId()

bool ShapeId::isRelativeShapeId ( ) const

Returns true if this Shape ID is a relative Shape ID, false otherwise.

Note
, Smithy defines a relative Shape ID as one that does not have a namespace.
See also
hasNameSpace.
Here is the call graph for this function:

◆ isRootShapeId()

bool ShapeId::isRootShapeId ( ) const

Returns true if this Shape ID is a root Shape ID, false otherwise.

Note
, Smithy defines a root Shape ID as one that does not have a member name.
See also
hasMemberName.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isValid()

bool ShapeId::isValid ( ) const

Returns true if this object represents a valid, non-empty Smithy Shape ID.

See also
https://awslabs.github.io/smithy/2.0/spec/model.html#shape-id
Here is the call graph for this function:
Here is the caller graph for this function:

◆ relativeShapeId()

QString ShapeId::relativeShapeId ( ) const

Returns this object as a relative Smithy Shape ID, that one without a leading namespace.

Note
, if the Shape ID is invalid (ie isValid() returns false) it still safe to invoke this method, but the result is undefined.
See also
isValid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setShapeName()

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.

Here is the call graph for this function:

◆ shapeName()

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.

See also
isValid
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

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.

Note
, if the Shape ID is invalid (ie isValid() returns false) it still safe to invoke this method, but the result is undefined.
See also
absoluteShapeId
relativeShapeId
isValid
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: