79 static tResult FromString(
const adtf_util::cString& strValue,
bool& bValue)
81 adtf::util::cStringUtil::ToType(strValue, bValue);
86 static tResult FromString(
const adtf_util::cString& strValue, T& oValue)
88 std::string_view strHelper(strValue.GetPtr());
89 if (strHelper.empty())
97 oValue = string_conversion::to_number<T>(strHelper, 0);
99 catch (
const std::overflow_error&)
101 if (strHelper.front() !=
'-')
103 oValue = std::numeric_limits<T>::max();
107 oValue = std::numeric_limits<T>::lowest();
110 catch (
const std::exception&)
112 bool bHelper =
false;
113 adtf::util::cStringUtil::ToType(strValue.GetPtr(), bHelper);
114 oValue =
static_cast<T
>(bHelper);
120 static tResult ToString(
const bool& oValue, adtf_util::cString& strValue)
122 strValue.Set(adtf_util::cString::FromType(oValue));
126 template <
typename TYPE>
127 static tResult ToString(
const TYPE& oValue, adtf_util::cString& strValue)
129 strValue.Set(string_conversion::to_string(oValue).c_str());
133 static tResult FromString(
const adtf_util::cString& strValue, adtf_util::cString& oValue)
135 oValue.Set(strValue);
139 static tResult ToString(
const adtf_util::cString& oValue, adtf_util::cString& strValue)
141 strValue.Set(oValue);
144 static tResult ToRaw(
const void* pData,
const size_t szSizeOfData,
IRawMemory& oToMem);
145 static tResult FromRaw(
const IRawMemory& oFromMem,
void* pData,
const size_t szSizeOfData);
171 return cPropertyConvert::Convert(oProp, oValue);
174 static tResult ToString(
const TYPE& oValue, adtf_util::cString& strValue)
176 return cPropertyConvert::ToString(oValue, strValue);
179 static tResult FromString(
const adtf_util::cString& strValue, TYPE& oValue)
181 return cPropertyConvert::FromString(strValue, oValue);
184 static tResult ToRaw(
const void* pData,
const size_t szSizeOfData,
IRawMemory& oToMem)
186 return cPropertyConvert::ToRaw(pData, szSizeOfData, oToMem);
189 static tResult FromRaw(
const IRawMemory& oFromMem,
void* pData,
const size_t szSizeOfData)
191 return cPropertyConvert::FromRaw(oFromMem, pData, szSizeOfData);
229 static tResult FromString(
const adtf_util::cString& oFromValue, adtf_util::cFilenameList& strToString);
230 static tResult ToString(
const adtf_util::cFilenameList& strFromString, adtf_util::cString& oToValue);
233 static tResult FromString(
const adtf_util::cString& oFromValue, adtf_util::cFilepathList& strToString);
234 static tResult ToString(
const adtf_util::cFilepathList& strFromString, adtf_util::cString& oToValue);
236 static tResult ToRaw(
const void* pData,
const size_t szSizeOfData,
IRawMemory& oToMem);
237 static tResult FromRaw(
const IRawMemory& oFromMem,
void* pData,
const size_t szSizeOfData);
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.
Copyright © Audi Electronics Venture GmbH.