28 #include "NamespaceHelper.h" 30 ONIXS_HANDLER_NAMESPACE_BEGIN
40 str += (value ?
"true" :
"false");
62 const std::string& item)
75 Iterator containerBegin,
76 Iterator containerEnd,
77 const std::string& delimiter =
",")
79 bool addDelimiter =
false;
82 containerBegin != containerEnd)
105 const Char* enumeration,
111 "Cannot convert constant to/from text " 112 "because it's out of a valid range " 115 reason += enumeration;
116 reason +=
",constant=";
118 toStr(reason, constant);
122 throw std::out_of_range(reason);
125 ONIXS_HANDLER_NAMESPACE_END
128 ONIXS_ENUM_TO_STR_BEGIN(Enumeration) \ 132 Enumeration::Enum value) \ 142 ONIXS_ENUM_TO_STR_ENTRY(Value) \ 143 case Values::Value: \ 148 ONIXS_ENUM_TO_STR_CUSTOM_ENTRY(Value, Str) \ 149 case Values::Value: \ 154 ONIXS_ENUM_TO_STR_END(Enumeration) \ 156 std::stringstream ss;\ 158 str += "Undefined("; \ 165 ONIXS_STR_TO_ENUM_BEGIN(Enumeration) \ 167 strTo##Enumeration( \ 168 const std::string& str) \ 175 ONIXS_STR_TO_ENUM_ENTRY(Value) \ 177 return Values::Value; 180 ONIXS_STR_TO_ENUM_CUSTOM_ENTRY(Value, Str) \ 182 return Values::Value; 185 ONIXS_STR_TO_ENUM_END(Enumeration) \ 186 throwOutOfEnumRange( \ 192 <Enumeration::Enum> \ 197 ONIXS_FROM_STR_BEGIN(Enumeration) \ 200 Enumeration::Enum& value,\ 208 const StrRef strRef(str, size); 211 ONIXS_FROM_STR_ENTRY(Value) \ 212 if (strRef == #Value) \ 214 value = Values::Value; \ 220 ONIXS_FROM_STR_CUSTOM_ENTRY(Value, Str) \ 223 value = Values::Value; \ 229 ONIXS_FROM_STR_END(Enumeration) \ 234 ONIXS_DECLARE_T0_STR_FUNCTIONS(Type) \ 235 void toStr(std::string&, Type);\ 236 inline std::string toStr(Type value)\ char Char
Character type alias.
void containerToStr(std::string &str, Iterator containerBegin, Iterator containerEnd, const std::string &delimiter=",")
void boolToStr(std::string &str, bool value)
void itemToStr(std::string &str, const std::string &item)
void throwOutOfEnumRange(const Char *enumeration, Constant constant)
ONIXS_SGXTITAN_ITCH_API void toStr(std::string &, MessageType::Enum)
Appends string presentation of object.