MIRA
Public Member Functions | Static Public Member Functions | Friends | List of all members
ResourceName Class Reference

Class for storing/combining/managing resource names consisting of namespaces and names separated by '/' Resource names can be combined and normalized. More...

#include <fw/ResourceName.h>

Public Member Functions

 ResourceName ()
 Creates default empty resource name. More...
 
 ResourceName (const std::string &name)
 Creates a normalized resource from a name. More...
 
 ResourceName (const char *name)
 Variant for normal C-Strings. More...
 
 ResourceName (const ResourceName &other)
 
const ResourceNameoperator= (const std::string &other)
 Assignment for strings. More...
 
const ResourceNameoperator= (const ResourceName &other)
 
 operator const std::string & () const
 Casts ResourceName into std::string. More...
 
const std::string & str () const
 Returns the underlying string containing the name. More...
 
ResourceName parent () const
 Returns parent namespace. More...
 
std::string leaf () const
 Returns the leaf, i.e. the bottom most name (the string after the last / ). More...
 
bool isAncestorOf (const ResourceName &other) const
 Returns true, if this node is an ancestor of "other" in the namespace hierarchy. More...
 
bool isParentOf (const ResourceName &other) const
 Returns true, if this node is the direct ancestor (parent) of "other" in the namespace hierarchy. More...
 
bool isSuccessorOf (const ResourceName &other) const
 Returns true, if this node is a successor of "other" in the namespace hierarchy. More...
 
bool isChildOf (const ResourceName &other) const
 Returns true, if this node is the direct successor (child) of "other" in the namespace hierarchy. More...
 
std::string::value_type operator[] (std::string::size_type i)
 Returns the i-th character in the name. More...
 
template<typename Reflector >
void reflect (Reflector &r)
 
std::string operator/ (const std::string &other) const
 Concatenates two resource names separated by a '/'. More...
 
ResourceName operator/ (const ResourceName &other) const
 Concatenates two resource names separated by a '/'. More...
 
const ResourceNameoperator/= (const ResourceName &other)
 Concatenates this with another resource names separated by a '/'. More...
 
bool isRoot () const
 Returns true, if this is the root namespace "/". More...
 
bool isFullyQualified () const
 Returns true, if the name is fully qualified. More...
 
Comparison operators
bool operator< (const ResourceName &other) const
 
bool operator<= (const ResourceName &other) const
 
bool operator> (const ResourceName &other) const
 
bool operator>= (const ResourceName &other) const
 
bool operator== (const ResourceName &other) const
 
bool operator!= (const ResourceName &other) const
 

Static Public Member Functions

static ResourceName makeFullyQualified (const ResourceName &name, const ResourceName &ns)
 

Friends

std::ostream & operator<< (std::ostream &os, const ResourceName &name)
 
std::istream & operator>> (std::istream &is, ResourceName &name)
 

Detailed Description

Class for storing/combining/managing resource names consisting of namespaces and names separated by '/' Resource names can be combined and normalized.

Constructor & Destructor Documentation

◆ ResourceName() [1/4]

ResourceName ( )
inline

Creates default empty resource name.

◆ ResourceName() [2/4]

ResourceName ( const std::string &  name)
inline

Creates a normalized resource from a name.

◆ ResourceName() [3/4]

ResourceName ( const char *  name)
inline

Variant for normal C-Strings.

◆ ResourceName() [4/4]

ResourceName ( const ResourceName other)
inline

Member Function Documentation

◆ operator=() [1/2]

const ResourceName& operator= ( const std::string &  other)
inline

Assignment for strings.

◆ operator=() [2/2]

const ResourceName& operator= ( const ResourceName other)
inline

◆ operator const std::string &()

operator const std::string & ( ) const
inline

Casts ResourceName into std::string.

◆ str()

const std::string& str ( ) const
inline

Returns the underlying string containing the name.

◆ parent()

ResourceName parent ( ) const

Returns parent namespace.

If *this has no parent (e.g. "namewithoutparent"), it returns an empty ResourceName.

◆ leaf()

std::string leaf ( ) const

Returns the leaf, i.e. the bottom most name (the string after the last / ).

◆ isAncestorOf()

bool isAncestorOf ( const ResourceName other) const

Returns true, if this node is an ancestor of "other" in the namespace hierarchy.

◆ isParentOf()

bool isParentOf ( const ResourceName other) const

Returns true, if this node is the direct ancestor (parent) of "other" in the namespace hierarchy.

◆ isSuccessorOf()

bool isSuccessorOf ( const ResourceName other) const

Returns true, if this node is a successor of "other" in the namespace hierarchy.

◆ isChildOf()

bool isChildOf ( const ResourceName other) const

Returns true, if this node is the direct successor (child) of "other" in the namespace hierarchy.

◆ operator<()

bool operator< ( const ResourceName other) const
inline

◆ operator<=()

bool operator<= ( const ResourceName other) const
inline

◆ operator>()

bool operator> ( const ResourceName other) const
inline

◆ operator>=()

bool operator>= ( const ResourceName other) const
inline

◆ operator==()

bool operator== ( const ResourceName other) const
inline

◆ operator!=()

bool operator!= ( const ResourceName other) const
inline

◆ operator[]()

std::string::value_type operator[] ( std::string::size_type  i)
inline

Returns the i-th character in the name.

◆ reflect()

void reflect ( Reflector &  r)
inline

◆ operator/() [1/2]

std::string operator/ ( const std::string &  other) const
inline

Concatenates two resource names separated by a '/'.

◆ operator/() [2/2]

ResourceName operator/ ( const ResourceName other) const
inline

Concatenates two resource names separated by a '/'.

◆ operator/=()

const ResourceName& operator/= ( const ResourceName other)
inline

Concatenates this with another resource names separated by a '/'.

◆ isRoot()

bool isRoot ( ) const
inline

Returns true, if this is the root namespace "/".

◆ isFullyQualified()

bool isFullyQualified ( ) const
inline

Returns true, if the name is fully qualified.

◆ makeFullyQualified()

static ResourceName makeFullyQualified ( const ResourceName name,
const ResourceName ns 
)
static

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ResourceName name 
)
friend

◆ operator>>

std::istream& operator>> ( std::istream &  is,
ResourceName name 
)
friend

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