11 #include "adtf_base_type_traits.h"
43 virtual const char*
Get()
const = 0;
72 static_assert(penguin::detail::always_false<T>,
73 "Unsupported type T! See documentation which types are supported."
74 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
84 static_assert(penguin::detail::always_false<T>,
85 "Unsupported type T! See documentation which types are supported."
86 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
101 static_assert(penguin::detail::always_false<T>,
102 "Unsupported type T! See documentation which types are supported."
103 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
117 return pValue->c_str();
122 return static_cast<size_t>(pValue->length());
127 pValue->assign(strValue);
140 return pValue->GetPtr();
144 return static_cast<size_t>(pValue->GetLength());
148 pValue->Set(strValue);
168 static const char*
GetConstChar(
const char*
const pValue)
174 return static_cast<size_t>(adtf_util::cStringUtil::GetLength(pValue));
191 template <
typename T>
235 if (strValue !=
nullptr)
244 const char*
Get()
const override
246 const tChar* strValue =
"";
264 using ant::adtf_string_forward;
265 using ant::adtf_string;
303 #define adtf_string_intf( __string__) ::adtf::base::adtf_string<typename std::remove_reference<decltype(__string__)>::type>(& (__string__))
307 #define adtf_char_intf( __const_char_ptr__) ::adtf::base::adtf_string<const char>(__const_char_ptr__)
Copyright © Audi Electronics Venture GmbH.
A common result class usable as return value throughout.
The IString interface provides methods for getting and setting strings through abstract interfaces.
virtual const char * Get() const =0
Gets the pointer to the current associated nullterminated-string.
static constexpr size_t InvalidPos
Invalid Position size.
virtual size_t GetLength() const =0
Gets the current size of the strng.
virtual tResult Set(const char *strValue)=0
Sets the given null-terminated string to the implementation.
Wrapping template for a rvalue reference of an IString interface for the type T (see Supported types ...
tResult Set(const char *strValue) override
Sets the given null-terminated string to the implementation.
adtf_string(adtf_string &&strValue)=delete
move CTOR
adtf_string(value_type *pstrAssignValue)
CTOR with pointer to the value of value_type.
value_type * m_pAssignValue
pointer to the value
adtf_string(const adtf_string &strValue)=delete
copy CTOR
adtf_string< T > self_type
self type
size_t GetLength() const override
Gets the current size of the strng.
adtf_string & operator=(const adtf_string &strValue)=delete
copy operator
adtf_string()=delete
CTOR.
adtf_string_forward< T > base_type
base type
const char * Get() const override
Gets the pointer to the current associated nullterminated-string.
adtf_string & operator=(adtf_string &&strValue)=delete
move operator
string_base< cStackString > cString
cString implementation for a stack string which works on stack if string is lower than A_UTILS_DEFAUL...
Namespace for entire ADTF SDK.
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
constexpr tSize g_npos
npos size declaration
static tResult SetValue(std::string *const pValue, const char *strValue)
Sets the given strValue to the string type implementation of the given pValue.
static size_t GetCurrentLength(const std::string *const pValue)
Retrieves the string size of the given pValue.
static const char * GetConstChar(const std::string *const pValue)
Retrieves a const char pointer (null-terminated).
Implementation concept template for user defined adtf_string type support (see Supported types for ad...
static const char * GetConstChar(const T *const pValue)
Retrieves a const char pointer (null-terminated).
static size_t GetCurrentLength(const T *const pValue)
Retrieves the string size of the given pValue.
static tResult SetValue(T *const pValue, const char *strValue)
Sets the given strValue to the string type implementation of the given pValue.