47 #ifndef _MIRA_RESOURCENAME_H_ 48 #define _MIRA_RESOURCENAME_H_ 72 ResourceName(
const std::string& name,
bool dontNormalize) : mName(name) {}
82 "Trying to create ResourceName from invalid name: '" 90 "Trying to create ResourceName from invalid name: '" 100 mName = normalize(other);
110 #if defined(MIRA_GNUC_VERSION) 111 # if MIRA_GNUC_VERSION >= 40601 112 operator std::string()
const {
return mName; }
114 operator const std::string&()
const {
return mName; }
118 operator const std::string&()
const {
return mName; }
122 const std::string&
str()
const {
return mName; }
134 std::string
leaf()
const;
163 std::string::value_type
operator[](std::string::size_type i) {
return mName[i]; }
166 template<
typename Reflector>
176 return mName + other;
179 return mName +
"/" + other;
192 mName += other.mName;
194 mName +=
"/" + other.mName;
202 return mName.size()==1 && mName[0]==
'/';
212 return mName[0]==
'/';
238 static std::string normalize(
const std::string& name);
241 static bool validate(
const std::string& name);
250 template<
typename SerializerTag>
const ResourceName & operator=(const ResourceName &other)
Definition: ResourceName.h:104
bool isRoot() const
Returns true, if this is the root namespace "/".
Definition: ResourceName.h:201
Type trait that indicates whether a type should be serialized "transparently", i.e.
Definition: IsTransparentSerializable.h:81
ResourceName(const char *name)
Variant for normal C-Strings.
Definition: ResourceName.h:87
ResourceName(const std::string &name)
Creates a normalized resource from a name.
Definition: ResourceName.h:79
bool operator<=(const ResourceName &other) const
Definition: ResourceName.h:153
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
friend std::istream & operator>>(std::istream &is, ResourceName &name)
Definition: ResourceName.h:228
ResourceName operator/(const ResourceName &other) const
Concatenates two resource names separated by a '/'.
Definition: ResourceName.h:185
const ResourceName & operator/=(const ResourceName &other)
Concatenates this with another resource names separated by a '/'.
Definition: ResourceName.h:190
Provides type trait that indicates whether a type should be serialized "transparently".
static ResourceName makeFullyQualified(const ResourceName &name, const ResourceName &ns)
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:78
bool operator==(const ResourceName &other) const
Definition: ResourceName.h:156
friend std::ostream & operator<<(std::ostream &os, const ResourceName &name)
Definition: ResourceName.h:222
bool isFullyQualified() const
Returns true, if the name is fully qualified.
Definition: ResourceName.h:208
Commonly used exception classes.
const ResourceName & operator=(const std::string &other)
Assignment for strings.
Definition: ResourceName.h:99
bool operator>(const ResourceName &other) const
Definition: ResourceName.h:154
Class for storing/combining/managing resource names consisting of namespaces and names separated by '...
Definition: ResourceName.h:67
ResourceName(const ResourceName &other)
Definition: ResourceName.h:94
ResourceName parent() const
Returns parent namespace.
std::string leaf() const
Returns the leaf, i.e. the bottom most name (the string after the last / ).
void reflect(Reflector &r)
Definition: ResourceName.h:167
const std::string & str() const
Returns the underlying string containing the name.
Definition: ResourceName.h:122
std::string::value_type operator[](std::string::size_type i)
Returns the i-th character in the name.
Definition: ResourceName.h:163
bool isParentOf(const ResourceName &other) const
Returns true, if this node is the direct ancestor (parent) of "other" in the namespace hierarchy...
bool operator>=(const ResourceName &other) const
Definition: ResourceName.h:155
bool isSuccessorOf(const ResourceName &other) const
Returns true, if this node is a successor of "other" in the namespace hierarchy.
ResourceName()
Creates default empty resource name.
Definition: ResourceName.h:76
bool operator<(const ResourceName &other) const
Definition: ResourceName.h:152
bool isAncestorOf(const ResourceName &other) const
Returns true, if this node is an ancestor of "other" in the namespace hierarchy.
bool operator!=(const ResourceName &other) const
Definition: ResourceName.h:157
bool isChildOf(const ResourceName &other) const
Returns true, if this node is the direct successor (child) of "other" in the namespace hierarchy...
std::string operator/(const std::string &other) const
Concatenates two resource names separated by a '/'.
Definition: ResourceName.h:174