Utility type that may be used to store resourcing information.
Besides constructor ResourceInfo(ResourcePool*, NString, NString) and corresponding Set method, templated alternatives exist, which are applicable if ResourcedTraits is specialized for the template type.
Definition at line 408 of file resources.inl.
◆ Category
NString alib::resources::ResourceInfo::Category |
◆ Name
NString alib::resources::ResourceInfo::Name |
◆ Pool
◆ ResourceInfo() [1/2]
Constructor setting the fields of this object as given.
- Parameters
-
pool | The resource pool. |
category | The resource category. |
name | The resource name. |
Definition at line 428 of file resources.inl.
◆ ResourceInfo() [2/2]
template<typename T>
alib::resources::ResourceInfo::ResourceInfo |
( |
const T & | sample | ) |
|
|
inline |
Templated constructor which sets the fields of this object according to the values provided with a specialization of ResourcedTraits for type T.
- Template Parameters
-
T | Type that disposes of a specialization of ResourcedTraits. Deduced by the compiler |
- Parameters
-
sample | A sample instance of type T. Exclusively used to have the compiler deduce type T (otherwise ignored). |
Definition at line 441 of file resources.inl.
◆ Get() [1/3]
const String & alib::resources::ResourceInfo::Get |
( |
| ) |
|
|
inline |
Receives the resource string according to this info object.
- Returns
- The externalized resource string.
Definition at line 474 of file resources.inl.
◆ Get() [2/3]
const String & alib::resources::ResourceInfo::Get |
( |
const NString & | name, |
|
|
bool | dbgAssert ) |
|
inline |
Variant of parameterless version Get() that ignores field Name and instead uses given argument name .
- Parameters
-
name | The resource name to use, given as string of narrow character width. |
dbgAssert | This parameter is available (and to be passed) only in debug mode. If true , an error is raised if the resource was not found. |
- Returns
- The externalized resource string.
◆ Get() [3/3]
const String & alib::resources::ResourceInfo::Get |
( |
const String & | name, |
|
|
bool | dbgAssert ) |
|
inline |
Variant of mehtod Get(const NString&, bool) that accepts a character string of standard character width instead of a narrow type.
- Availability
- Available only if ALIB_CHARACTERS_WIDE evaluates to
true
.
- Parameters
-
name | The resource name to use, given as string of standard character width. |
dbgAssert | This parameter is available (and to be passed) only in debug mode. If true , an error is raised if the resource was not found. |
- Returns
- The externalized resource string.
◆ Set() [1/2]
void alib::resources::ResourceInfo::Set |
( |
const T & | sample | ) |
|
|
inline |
Sets the fields of this object according to the values provided with a specialization of ResourcedTraits for type T.
- Template Parameters
-
T | Type that disposes of a specialization of ResourcedTraits. Deduced by the compiler |
- Parameters
-
sample | A sample instance of type T. Exclusively used to have the compiler deduce type T (otherwise ignored). |
Definition at line 464 of file resources.inl.
◆ Set() [2/2]
Sets the fields of this object as given.
- Parameters
-
pool | The resource pool. |
category | The resource category. |
name | The resource name. |
Definition at line 448 of file resources.inl.
The documentation for this struct was generated from the following file: