46 virtual const char*
Get()
const = 0;
67 static constexpr bool is_mutable =
false;
77 "Unsupported type T! See documentation which types are supported."
78 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the "
79 "adtf_string_forward<T> for the type T!");
90 "Unsupported type T! See documentation which types are supported."
91 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the "
92 "adtf_string_forward<T> for the type T!");
108 "Unsupported type T! See documentation which types are supported."
109 "adtf_string<T> only supports std::string and adtf_util::cString types unless you specialize the "
110 "adtf_string_forward<T> for the type T!");
121 static constexpr bool is_mutable =
true;
126 return pValue->c_str();
131 return static_cast<size_t>(pValue->length());
136 pValue->assign(strValue);
147 static constexpr bool is_mutable =
false;
162 static constexpr bool is_mutable =
false;
167 return pValue->c_str();
172 return static_cast<size_t>(pValue->length());
200 static constexpr bool is_mutable =
true;
202 static const char*
GetConstChar(
const adtf_util::cString*
const pValue)
204 return pValue->GetPtr();
208 return static_cast<size_t>(pValue->GetLength());
210 static tResult SetValue(adtf_util::cString*
const pValue,
const char* strValue )
212 pValue->Set(strValue);
223 static constexpr bool is_mutable =
false;
254 static constexpr bool is_mutable =
false;
256 static const char*
GetConstChar(
const char*
const pValue)
262 return static_cast<size_t>(adtf_util::cStringUtil::GetLength(pValue));
283 typedef adtf_string<T> self_type;
285 typedef T value_type;
291 value_type* m_pAssignValue;
293 adtf_string() =
delete;
296 adtf_string(
const adtf_string& strValue) =
delete;
299 adtf_string(adtf_string&& strValue) =
delete;
303 adtf_string& operator=(
const adtf_string& strValue) =
delete;
307 adtf_string& operator=(adtf_string&& strValue) =
delete;
314 m_pAssignValue = pstrAssignValue;
319 m_pAssignValue =
nullptr;
323 if constexpr (std::is_const_v<T>)
327 else if (strValue !=
nullptr)
336 const char*
Get()
const override
338 const char* strValue =
"";
339 if (m_pAssignValue !=
nullptr)
347 if (m_pAssignValue !=
nullptr)
365 cStringLengthProxy(
const char* strValue): m_strValue(strValue)
378 m_nSize = std::strlen(m_strValue);
384 const char*
Get()
const override
390 const char* m_strValue;
391 mutable std::optional<size_t> m_nSize;
400 cStringRedirect(std::function<
tResult(
const ant::IString&)> fnForward): m_fnForward(std::move(fnForward))
414 const char*
Get()
const override
425using ant::adtf_string_forward;
426using ant::adtf_string;
429using spider::cStringRedirect;
465#define adtf_string_intf(__string__) \
466 static_cast<std::conditional_t< \
467 ::adtf::base::adtf_string_forward<typename std::remove_reference_t<decltype(__string__)>>::is_mutable, \
468 ::adtf::base::IString&&, const ::adtf::base::IString&&>>( \
469 ::adtf::base::adtf_string<typename std::remove_reference<decltype(__string__)>::type>(&(__string__)))
473#define adtf_char_intf(__const_char_ptr__) \
474 static_cast<const ::adtf::base::IString&&>(::adtf::base::adtf_string<const char>(__const_char_ptr__))
Definition for type traits helper Copyright © Audi Electronics Venture GmbH. All rights reserved.
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
#define RETURN_NOERROR
Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
Definition result.h:29
#define RETURN_ERROR(code)
Return specific error code, which requires the calling function's return type to be tResult.
Definition result.h:42
Definition string_intf.h:29
static constexpr size_t InvalidPos
Invalid Position size.
Definition string_intf.h:32
virtual size_t GetLength() const =0
virtual const char * Get() const =0
virtual tResult Set(const char *strValue)=0
~adtf_string()
DTOR.
Definition string_intf.h:317
const char * Get() const override
Definition string_intf.h:336
adtf_string(value_type *pstrAssignValue)
Definition string_intf.h:312
tResult Set(const char *strValue) override
Definition string_intf.h:321
size_t GetLength() const override
Definition string_intf.h:345
Definition string_intf.h:363
size_t GetLength() const override
Definition string_intf.h:374
tResult Set(const char *) override
Definition string_intf.h:369
const char * Get() const override
Definition string_intf.h:384
size_t GetLength() const override
Definition string_intf.h:409
const char * Get() const override
Definition string_intf.h:414
tResult Set(const char *strValue) override
Definition string_intf.h:404
Namespace for all functionality of the ADTF Base SDK provided since v3.0.
Definition adtf_class_version.h:16
constexpr bool always_false
helper template to get a always false expression.
Definition adtf_base_type_traits.h:23
Namespace for the ADTF Base SDK.
Definition adtf_base_type_traits.h:13
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
static tResult SetValue(const adtf_util::cString *const, const char *)
Definition string_intf.h:226
static tResult SetValue(const std::string *const, const char *)
Definition string_intf.h:150
static tResult SetValue(const std::string_view *const, const char *)
Definition string_intf.h:188
static tResult SetValue(std::string *const pValue, const char *strValue)
Definition string_intf.h:134
static const char * GetConstChar(const std::string *const pValue)
Definition string_intf.h:124
static size_t GetCurrentLength(const std::string *const pValue)
Definition string_intf.h:129
static const char * GetConstChar(const std::string *const pValue)
Definition string_intf.h:165
static size_t GetCurrentLength(const std::string *const pValue)
Definition string_intf.h:170
static tResult SetValue(std::string_view *const, const char *)
Definition string_intf.h:175
Definition string_intf.h:66
static size_t GetCurrentLength(const T *const pValue)
Definition string_intf.h:87
static tResult SetValue(T *const pValue, const char *strValue)
Definition string_intf.h:105
static const char * GetConstChar(const T *const pValue)
Definition string_intf.h:74