20 #ifndef __ACCESSIBILITY__
21 #define __ACCESSIBILITY__
31 std::string strSchemeId;
34 std::string valueType;
36 bool isNumber(
const std::string& str)
38 std::string::const_iterator it = str.begin();
39 while (it != str.end() && std::isdigit(*it)) ++it;
40 return !str.empty() && it == str.end();
44 Accessibility(std::string schemId, std::string val): strSchemeId(schemId), intValue(-1), strValue(
""), valueType(
"")
48 valueType =
"int_value";
49 intValue = std::stoi(val);
54 valueType =
"string_value";
61 Accessibility():strSchemeId(
""), intValue(-1), strValue(
""), valueType(
"") {};
63 void setAccessibilityData(std::string schemId, std::string val)
65 strSchemeId = schemId;
68 valueType =
"int_value";
69 intValue = std::stoi(val);
74 valueType =
"string_value";
80 void setAccessibilityData(std::string schemId,
int val)
82 strSchemeId = schemId;
83 valueType =
"int_value";
88 std::string& getTypeName() {
return valueType;};
89 std::string& getSchemeId() {
return strSchemeId;};
90 int getIntValue() {
return intValue;};
91 std::string& getStrValue() {
return strValue;};
102 return ((strSchemeId == track.strSchemeId) &&
103 (valueType ==
"int_value"?(intValue == track.intValue):(strValue == track.strValue)));
108 return ((strSchemeId != track.strSchemeId) ||
109 (valueType ==
"int_value"?(intValue != track.intValue):(strValue != track.strValue)));
114 strSchemeId = track.strSchemeId;
115 intValue = track.intValue;
116 strValue = track.strValue;
117 valueType = track.valueType;
125 std::string retVal =
"";
126 if (!strSchemeId.empty())
128 std::snprintf(strData,
sizeof(strData),
"{ scheme:%s, %s:", strSchemeId.c_str(), valueType.c_str());
130 if (valueType ==
"int_value")
132 std::snprintf(strData,
sizeof(strData),
"%d }", intValue);
135 std::snprintf(strData,
sizeof(strData),
"%s }", strValue.c_str());
147 #endif // __ACCESSIBILITY__