47 #ifndef _MIRA_RESOURCENAME_H_ 48 #define _MIRA_RESOURCENAME_H_ 73 ResourceName(
const std::string& name,
bool dontNormalize) : mName(name) {}
83 "Trying to create ResourceName from invalid name: '" 91 "Trying to create ResourceName from invalid name: '" 101 mName = normalize(other);
111 #if defined(MIRA_GNUC_VERSION) 112 # if MIRA_GNUC_VERSION >= 40601 113 operator std::string()
const {
return mName; }
115 operator const std::string&()
const {
return mName; }
119 operator const std::string&()
const {
return mName; }
123 const std::string&
str()
const {
return mName; }
135 std::string leaf()
const;
164 std::string::value_type
operator[](std::string::size_type i) {
return mName[i]; }
167 template<
typename Reflector>
177 return mName + other;
180 return mName +
"/" + other;
193 mName += other.mName;
195 mName +=
"/" + other.mName;
203 return mName.size()==1 && mName[0]==
'/';
213 return mName[0]==
'/';
239 static std::string normalize(
const std::string& name);
242 static bool validate(
const std::string& name);
251 template<
typename SerializerTag>
const ResourceName & operator=(const ResourceName &other)
Definition: ResourceName.h:105
bool isRoot() const
Returns true, if this is the root namespace "/".
Definition: ResourceName.h:202
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:88
ResourceName(const std::string &name)
Creates a normalized resource from a name.
Definition: ResourceName.h:80
bool operator<=(const ResourceName &other) const
Definition: ResourceName.h:154
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:229
ResourceName operator/(const ResourceName &other) const
Concatenates two resource names separated by a '/'.
Definition: ResourceName.h:186
const ResourceName & operator/=(const ResourceName &other)
Concatenates this with another resource names separated by a '/'.
Definition: ResourceName.h:191
Provides type trait that indicates whether a type should be serialized "transparently".
Framework export macro declaration.
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:82
bool operator==(const ResourceName &other) const
Definition: ResourceName.h:157
friend std::ostream & operator<<(std::ostream &os, const ResourceName &name)
Definition: ResourceName.h:223
bool isFullyQualified() const
Returns true, if the name is fully qualified.
Definition: ResourceName.h:209
Commonly used exception classes.
const ResourceName & operator=(const std::string &other)
Assignment for strings.
Definition: ResourceName.h:100
bool operator>(const ResourceName &other) const
Definition: ResourceName.h:155
Class for storing/combining/managing resource names consisting of namespaces and names separated by '...
Definition: ResourceName.h:68
#define MIRA_FRAMEWORK_EXPORT
Definition: FrameworkExports.h:61
ResourceName(const ResourceName &other)
Definition: ResourceName.h:95
void reflect(Reflector &r)
Definition: ResourceName.h:168
const std::string & str() const
Returns the underlying string containing the name.
Definition: ResourceName.h:123
std::string::value_type operator[](std::string::size_type i)
Returns the i-th character in the name.
Definition: ResourceName.h:164
bool operator>=(const ResourceName &other) const
Definition: ResourceName.h:156
ResourceName()
Creates default empty resource name.
Definition: ResourceName.h:77
bool operator<(const ResourceName &other) const
Definition: ResourceName.h:153
bool operator!=(const ResourceName &other) const
Definition: ResourceName.h:158
std::string operator/(const std::string &other) const
Concatenates two resource names separated by a '/'.
Definition: ResourceName.h:175