ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Fields | Public Methods | List of all members
ResourceInfo Struct Reference

#include <resources.hpp>

Collaboration diagram for ResourceInfo:
[legend]

Class Description

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 T_Resourced is specialized for the template type.

Definition at line 480 of file resources.hpp.

Public Fields

NString Category
 
NString Name
 
resources::ResourcePoolPool
 

Public Methods

 ResourceInfo () noexcept=default
 
template<typename T >
 ResourceInfo (const T &sample)
 
template<typename T >
 ResourceInfo (resources::ResourcePool *pool, NString category, NString name)
 
const StringGet (const NString &name, bool dbgAssert)
 
template<typename T >
void Set (const T &sample) inline const String &Get()
 
void Set (resources::ResourcePool *pool, NString category, NString name)
 

Constructor & Destructor Documentation

◆ ResourceInfo() [1/3]

ResourceInfo ( )
defaultnoexcept

Defaulted constructor leaving the fields uninitialized.

◆ ResourceInfo() [2/3]

ResourceInfo ( resources::ResourcePool pool,
NString  category,
NString  name 
)
inline

Constructor setting the fields of this object as given.

Parameters
poolThe resource pool.
categoryThe resource category.
nameThe resource name.

Definition at line 502 of file resources.hpp.

◆ ResourceInfo() [3/3]

ResourceInfo ( const T &  sample)
inline

Templated constructor which sets the fields of this object according to the values provided with a specialization of T_Resourced for type T.

Template Parameters
TType that disposes about a specialization of T_Resourced. Deduced by the compiler
Parameters
sampleA sample instance of type T. Exclusively used to have the compiler deduce type T (otherwise ignored).

Definition at line 518 of file resources.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ Get()

const String& Get ( const NString name,
bool  dbgAssert 
)
inline

Variant of parameterless version Get() that ignores field Name and instead uses given argument name .

Parameters
nameThe resource name to use, given as string of narrow character width.
dbgAssertThis parameter is available only in debug mode. If true, an assertion is raised if the resource was not found.
Returns
The externalized resource string.

◆ Set() [1/2]

void Set ( const T &  sample) const &
inline

Sets the fields of this object according to the values provided with a specialization of T_Resourced for type T.

Template Parameters
TType that disposes about a specialization of T_Resourced. Deduced by the compiler
Parameters
sampleA sample instance of type T. Exclusively used to have the compiler deduce type T (otherwise ignored). Receives the resource string according to this info object.
Returns
The externalized resource string.

Definition at line 548 of file resources.hpp.

Here is the call graph for this function:

◆ Set() [2/2]

void Set ( resources::ResourcePool pool,
NString  category,
NString  name 
)
inline

Sets the fields of this object as given.

Parameters
poolThe resource pool.
categoryThe resource category.
nameThe resource name.

Definition at line 530 of file resources.hpp.

Member Data Documentation

◆ Category

NString Category

The resource category within Pool.

Definition at line 486 of file resources.hpp.

◆ Name

NString Name

The resource category within Pool.

Definition at line 489 of file resources.hpp.

◆ Pool

The resource pool.

Definition at line 483 of file resources.hpp.


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