ALib C++ Framework
by
Library Version: 2511 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 360 of file resources.inl.

Public Static Method Index:

template<typename TRequires = T>
static const StringGet ()
template<typename TRequires = T>
static const StringGet (const NString &name, bool dbgAssert)
template<typename TRequires = T>
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>
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 370 of file resources.inl.

◆ Get() [2/3]

template<typename T>
template<typename TRequires = T>
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 the macro ALIB_DBG with calls to this method.
Returns
The externalized resource string.

◆ Get() [3/3]

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

Variant of the method 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.

◆ 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 467 of file resources.inl.

◆ 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 static constexpr NString 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 449 of file resources.inl.


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