ADTF  3.13.0
adtf_string< T >

Wrapping template for a rvalue reference of an IString interface for the type T. 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 tChar *strValue) override
 Sets the given null-terminated string to the implementation. More...
 
const tCharGet () const override
 Gets the pointer to the current associated nullterminated-string. More...
 
tSize 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 tSize InvalidPos = g_npos
 Invalid Position size.
 
- Static Protected Member Functions inherited from adtf_string_forward< T >
static const tCharGetConstChar (const T *const pValue)
 Retrieves a const tChar pointer (null-terminated). More...
 
static tSize GetCurrentLength (const T *const pValue)
 Retrieves the string size of the given pValue. More...
 
static tResult SetValue (T *const pValue, const tChar *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.

Usually the IString is given as rvalue reference to a function call. This template will help to implement your own wrapper by given a specialization only for the adtf_string_forward.

Template Parameters
TThe User Type of a String implementation.

Definition at line 174 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 206 of file string_intf.h.

References adtf_string< T >::m_pAssignValue.

Member Function Documentation

◆ Get()

const tChar* 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 226 of file string_intf.h.

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

◆ GetLength()

tSize 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 235 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= ( const adtf_string< T > &  strValue)
privatedelete

copy operator

Parameters
[in]strValuevalue to copy from
Returns
this

◆ operator=() [2/2]

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

move operator

Parameters
[in]strValuevalue to move from
Returns
this

◆ Set()

tResult Set ( const tChar 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 215 of file string_intf.h.

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


Copyright © Audi Electronics Venture GmbH. All rights reserved. (Generated on Tue Sep 28 2021 by doxygen 1.8.14)