template<typename TString, typename TChar, typename TEnableIf = void>
struct aworx::lib::characters::T_CharArray< TString, TChar, TEnableIf >
This type provides type traits for character arrays. Specializations of this struct for a custom type TString, expose information about that type representing a character array and how the array data may be accessed.
In addition, information about how the type may be constructed from character array data may be provided with specializations of this type.
- See also
- For detailed information, see chapter 4. Character Arrays of the Programmer's Manual of module ALib Characters.
- Template Parameters
-
TString | The type for which specializations of this struct provide array type traits. |
TChar | The character type of the character array that specializations provide type traits for. |
TEnableIf | Optional TMP parameter to allow templated and/or selective specializations. |
Definition at line 294 of file characters.hpp.
static const TChar* Buffer |
( |
const TString & |
src | ) |
|
|
static |
In specialized versions, this method has to be provided in case that field Access is not equal to AccessType::NONE. In addition to this static method, sibling method Length has to be provoided.
For example, in a specialization for standard C++ class std::string
, this method returns the result of method std::string::data()
.
Note, that in the case of access type AccessType::MutableOnly, the signature of this method needs to be slightly different with the specialization: argument src in this case must be of type TString&
, hence must not be const
.
- Parameters
-
src | The source object of external type TString. |
- Returns
- Specializatins have to return a pointer to the start of the character array represented by the given object src of type TString.
static integer Length |
( |
const TString & |
src | ) |
|
|
static |
In specialized versions, this method has to be provided in case that field Access is not equal to AccessType::NONE. In addition to this static method, sibling method Buffer has to be provoided.
For example, in a specialization for standard C++ class std::string
, this method returns the result of method std::string::size()
.
Note, that in the case of access type AccessType::MutableOnly, the signature of this method needs to be slightly different with the specialization: argument src in this case must be of type TString&
, hence must not be const
.
- Parameters
-
src | The source object of external type TString. |
- Returns
- Specializatins have to return the length of the character array represented by the given object src of type TString.