ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
alib::resources::ResourcedType< T > Struct Template Reference

Description:

template<typename T>
struct alib::resources::ResourcedType< T >

Static helper-struct used to access resources of types that dispose of a specialization of the type trait ResourcedTraits.

See also
Template Parameters
TA type equipped with resource information by a specialization of ResourcedTraits.

Definition at line 276 of file resources.inl.

Public Static Method Index:

template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
static const StringGet ()
 
template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
static const StringGet (const NString &name, bool dbgAssert)
 
template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
static const StringGet (const String &resourceName, bool dbgAssert)
 
static const StringTypeNamePostfix ()
 
static const StringTypeNamePrefix ()
 

Method Details:

◆ Get() [1/3]

template<typename T>
template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
const String & alib::resources::ResourcedType< T >::Get ( )
inlinestatic

Static method that receives a resource string for a type which has a specialization of ResourcedTraits defined.

Template Parameters
TRequiresNot to be specified. Used by the compiler to select the availability of this method.
Returns
The externalized resource string.

Definition at line 286 of file resources.inl.

Here is the call graph for this function:

◆ Get() [2/3]

template<typename T>
template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
const String & alib::resources::ResourcedType< T >::Get ( const NString & name,
bool dbgAssert )
static

Variant of the parameterless version Get that ignores the resource name given for a type with a specialization of ResourcedTraits, but instead uses the name provided.

Template Parameters
TRequiresNot to be specified. Used by the compiler to select the availability of this method.
Parameters
nameThe resource name to use, given as string of narrow character width.
dbgAssertThis parameter is available (and to be passed) only in debug mode. If true, an error is raised if the resource was not found. Use macro ALIB_DBG with calls to this method.
Returns
The externalized resource string.
Here is the call graph for this function:

◆ Get() [3/3]

template<typename T>
template<typename TRequires = T>
requires alib::resources::HasResources<TRequires>
const String & alib::resources::ResourcedType< T >::Get ( const String & resourceName,
bool dbgAssert )
static

Variant of method alib::resources::ResourcedType::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.
Template Parameters
TRequiresNot to be specified. Used by the compiler to select the availability of this method.
Parameters
resourceNameThe resource name to use, given as a string of standard character width.
dbgAssertThis 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.
Here is the call graph for this function:

◆ TypeNamePostfix()

template<typename T>
const String & alib::resources::ResourcedType< T >::TypeNamePostfix ( )
inlinestatic

Same as TypeNamePrefix but for the postfix string of a types name. Consequently, extends the resource string's name searched by character '>'.

Returns
The postfix string.

Definition at line 384 of file resources.inl.

Here is the call graph for this function:

◆ TypeNamePrefix()

template<typename T>
const String & alib::resources::ResourcedType< T >::TypeNamePrefix ( )
inlinestatic

Together with sibling method TypeNamePostfix, this method may be used to receive the first portion of a type's human-readable name.

The method tries to standardize resourcing names of C++ types along with the resource string that is defined with the type trait ResourcedTraits for a type.

The prefix is tried to be retrieved by extending the resource name returned by the method ResourcedTraits::Name by character '<'.

ALib uses this method internally, for example with specializations AppendableTraits<TEnum,TChar,TAllocator> AppendableTraits<TBitwiseEnum,TChar,TAllocator> used to write element names of enum types.

If either ResourcedTraits is not specialized for TEnum, or a resource named "name>" is not found, an empty string is returned.

Returns
The prefix string.

Definition at line 365 of file resources.inl.

Here is the call graph for this function:

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