ADTF  3.18.2
adtf_string< T >

Wrapping template for a rvalue reference of an IString interface for the type T (see Supported types for adtf_string<T> for writing and reading strings via interface IString). More...

Inheritance diagram for adtf_string< T >:
[legend]

Public Member Functions

 adtf_string (value_type *pstrAssignValue)
 CTOR with pointer to the value of value_type. More...
 
 ~adtf_string ()
 DTOR.
 
tResult Set (const char *strValue) override
 Sets the given null-terminated string to the implementation. More...
 
const char * Get () const override
 Gets the pointer to the current associated nullterminated-string. More...
 
size_t GetLength () const override
 Gets the current size of the strng. More...
 

Private Types

typedef adtf_string< T > self_type
 self type
 
typedef T value_type
 value type
 
typedef adtf_string_forward< T > base_type
 base type
 

Private Member Functions

 adtf_string ()=delete
 CTOR.
 
 adtf_string (const adtf_string &strValue)=delete
 copy CTOR More...
 
 adtf_string (adtf_string &&strValue)=delete
 move CTOR More...
 
adtf_stringoperator= (const adtf_string &strValue)=delete
 copy operator More...
 
adtf_stringoperator= (adtf_string &&strValue)=delete
 move operator More...
 

Private Attributes

value_typem_pAssignValue
 pointer to the value
 

Additional Inherited Members

- Static Public Attributes inherited from IString
static constexpr size_t InvalidPos = g_npos
 Invalid Position size.
 
- Static Protected Member Functions inherited from adtf_string_forward< T >
static const char * GetConstChar (const T *const pValue)
 Retrieves a const char pointer (null-terminated). More...
 
static size_t GetCurrentLength (const T *const pValue)
 Retrieves the string size of the given pValue. More...
 
static tResult SetValue (T *const pValue, const char *strValue)
 Sets the given strValue to the string type implementation of the given pValue. More...
 

Detailed Description

template<typename T>
class adtf::base::ant::adtf_string< T >

Wrapping template for a rvalue reference of an IString interface for the type T (see Supported types for adtf_string<T> for writing and reading strings via interface IString).

Usually the IString is given as rvalue reference to a function call. This template used adtf_string_forward for special types.

Template Parameters
TThe String implementation to wrap into IString.

Definition at line 194 of file string_intf.h.

Constructor & Destructor Documentation

◆ adtf_string() [1/3]

adtf_string ( const adtf_string< T > &  strValue)
privatedelete

copy CTOR

Parameters
[in]strValueinitial value

◆ adtf_string() [2/3]

adtf_string ( adtf_string< T > &&  strValue)
privatedelete

move CTOR

Parameters
[in]strValueinitial value

◆ adtf_string() [3/3]

adtf_string ( value_type pstrAssignValue)
inlineexplicit

CTOR with pointer to the value of value_type.

Parameters
pstrAssignValue[in] pointer to the value

Definition at line 226 of file string_intf.h.

References adtf_string< T >::m_pAssignValue.

Member Function Documentation

◆ Get()

const char* Get ( ) const
inlineoverridevirtual

Gets the pointer to the current associated nullterminated-string.

Returns
The pointer to the null-terminated string.
Remarks
Check the pointer, because it depends on the implementation of IString!

Implements IString.

Definition at line 246 of file string_intf.h.

References adtf_string_forward< T >::GetConstChar(), and adtf_string< T >::m_pAssignValue.

◆ GetLength()

size_t GetLength ( ) const
inlineoverridevirtual

Gets the current size of the strng.

Usually this is in Bytes (null-termination is not included!)

Returns
The size of the string.
Return values
Ifnot valid return InvalidPos!

Implements IString.

Definition at line 255 of file string_intf.h.

References adtf_string_forward< T >::GetCurrentLength(), IString::InvalidPos, and adtf_string< T >::m_pAssignValue.

◆ operator=() [1/2]

adtf_string& operator= ( adtf_string< T > &&  strValue)
privatedelete

move operator

Parameters
[in]strValuevalue to move from
Returns
this

◆ operator=() [2/2]

adtf_string& operator= ( const adtf_string< T > &  strValue)
privatedelete

copy operator

Parameters
[in]strValuevalue to copy from
Returns
this

◆ Set()

tResult Set ( const char *  strValue)
inlineoverridevirtual

Sets the given null-terminated string to the implementation.

Parameters
strValue[in] The null-terminated string to set.
Return values
ERR_NOERRORThe value is set successfully
ERR_MEMORYThe value can not be set. Too long. No truncating provided.

Implements IString.

Definition at line 235 of file string_intf.h.

References adtf_string< T >::m_pAssignValue, RETURN_ERROR, and adtf_string_forward< T >::SetValue().