13#include "adtf_base_type_traits.h"
45 virtual const char*
Get()
const = 0;
75 "Unsupported type T! See documentation which types are supported."
76 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
87 "Unsupported type T! See documentation which types are supported."
88 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
104 "Unsupported type T! See documentation which types are supported."
105 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the adtf_string_forward<T> for the type T!");
119 return pValue->c_str();
124 return static_cast<size_t>(pValue->length());
129 pValue->assign(strValue);
140 static const char *
GetConstChar(
const adtf_util::cString*
const pValue)
142 return pValue->GetPtr();
146 return static_cast<size_t>(pValue->GetLength());
148 static tResult SetValue(adtf_util::cString*
const pValue,
const char* strValue)
150 pValue->Set(strValue);
170 static const char*
GetConstChar(
const char*
const pValue)
176 return static_cast<size_t>(adtf_util::cStringUtil::GetLength(pValue));
193 template <
typename T>
237 if (strValue !=
nullptr)
246 const char*
Get()
const override
248 const char* strValue =
"";
246 const char*
Get()
const override {
…}
272 cStringLengthProxy(
const char* strValue):
286 m_nSize = std::strlen(m_strValue);
292 const char*
Get()
const override
292 const char*
Get()
const override {
…}
298 const char* m_strValue;
299 mutable std::optional<size_t> m_nSize;
306 m_fnForward(std::move(fnForward))
320 const char*
Get()
const override
320 const char*
Get()
const override {
…}
331using ant::adtf_string_forward;
332using ant::adtf_string;
335using spider::cStringRedirect;
371#define adtf_string_intf( __string__) ::adtf::base::adtf_string<typename std::remove_reference<decltype(__string__)>::type>(& (__string__))
375#define adtf_char_intf( __const_char_ptr__) ::adtf::base::adtf_string<const char>(__const_char_ptr__)
Copyright © Audi Electronics Venture GmbH.
constexpr tSize g_npos
npos size declaration
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
#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.
adtf_string()=delete
CTOR.
The IString interface provides methods for getting and setting strings through abstract interfaces.
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.
virtual const char * Get() const =0
Gets the pointer to the current associated nullterminated-string.
adtf_string & operator=(adtf_string &&strValue)=delete
move operator
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
const char * Get() const override
Gets the pointer to the current associated nullterminated-string.
size_t GetLength() const override
Gets the current size of the strng.
adtf_string()=delete
CTOR.
adtf_string_forward< T > base_type
base type
adtf_string & operator=(const adtf_string &strValue)=delete
copy operator
const char * Get() const override
Gets the pointer to the current associated nullterminated-string.
tResult Set(const char *) override
Sets the given null-terminated string to the implementation.
size_t GetLength() const override
Gets the current size of the strng.
tResult Set(const char *strValue) override
Sets the given null-terminated string to the implementation.
const char * Get() const override
Gets the pointer to the current associated nullterminated-string.
size_t GetLength() const override
Gets the current size of the strng.
Namespace for all functionality of the ADTF Base SDK provided since v3.0.
constexpr bool always_false
helper template to get a always false expression.
Namespace for the ADTF Base SDK.
Namespace for entire ADTF SDK.
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 size_t GetCurrentLength(const T *const pValue)
Retrieves the string size of the given pValue.
static const char * GetConstChar(const T *const pValue)
Retrieves a const char pointer (null-terminated).
static tResult SetValue(T *const pValue, const char *strValue)
Sets the given strValue to the string type implementation of the given pValue.