11 #ifdef AJA_USE_CPLUSPLUS11
28 void AJAVariant::initialize()
65 mStringValue = std::string();
144 mStringValue = std::string(other.mStringValue);
153 AJAVariant::operator bool()
const
157 AJAVariant::operator float()
const
161 AJAVariant::operator double()
const
165 AJAVariant::operator int8_t()
const
169 AJAVariant::operator uint8_t()
const
173 AJAVariant::operator int16_t()
const
177 AJAVariant::operator uint16_t()
const
181 AJAVariant::operator int32_t()
const
185 AJAVariant::operator uint32_t()
const
189 AJAVariant::operator int64_t()
const
193 AJAVariant::operator uint64_t()
const
197 AJAVariant::operator std::string()
const
286 mStringValue = std::string(value);
290 mStringValue = std::string(value, length);
294 mStringValue = value;
325 if (!mStringValue.empty()) {
326 std::string tmp = std::string(mStringValue);
328 if (tmp ==
"true" || tmp ==
"1" || tmp ==
"y")
370 if (mStringValue.empty()) {
373 #ifdef AJA_USE_CPLUSPLUS11
374 return std::strtof(mStringValue.data(),
NULL);
376 return (
float)atof(mStringValue.data());
413 if (mStringValue.empty()) {
416 return strtod(mStringValue.data(),
NULL);
452 if (mStringValue.empty()) {
455 return static_cast<int8_t
>(strtol(mStringValue.data(),
NULL, 0));
491 if (mStringValue.empty()) {
494 return static_cast<uint8_t
>(strtol(mStringValue.data(),
NULL, 0));
530 if (mStringValue.empty()) {
533 return static_cast<int16_t
>(strtol(mStringValue.data(),
NULL, 0));
569 if (mStringValue.empty()) {
572 return static_cast<uint16_t
>(strtol(mStringValue.data(),
NULL, 0));
608 if (mStringValue.empty()) {
611 return static_cast<int32_t
>(strtol(mStringValue.data(),
NULL, 0));
647 if (mStringValue.empty()) {
650 return strtoul(mStringValue.data(),
NULL, 0);
686 if (mStringValue.empty()) {
689 #ifdef AJA_USE_CPLUSPLUS11
690 return std::strtoll(mStringValue.data(),
NULL, 0);
692 return atol(mStringValue.data());
729 if (mStringValue.empty()) {
732 #ifdef AJA_USE_CPLUSPLUS11
733 return std::strtoull(mStringValue.data(),
NULL, 0);
736 const char* data = mStringValue.data();
737 #if defined(_MSC_VER) && _MSC_VER < 1900
738 unsigned long value = _strtoui64(data, &endptr, 10);
740 unsigned long value = strtoull(data, &endptr, 10);
783 return std::string();
786 return std::string();