diff options
author | B. Stack <bgstack15@gmail.com> | 2021-04-05 15:59:11 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-04-05 15:59:11 +0000 |
commit | 8d28254d708c88ae4aaebbc82cbb6c91726aa390 (patch) | |
tree | dafb5e266c513a5ed9863401e62d246742861e0c /zenXml/zenxml/cvrt_text.h | |
parent | Merge branch '11.7' into 'master' (diff) | |
parent | add upstream 11.9 (diff) | |
download | FreeFileSync-11.9.tar.gz FreeFileSync-11.9.tar.bz2 FreeFileSync-11.9.zip |
Merge branch '11.9' into 'master'11.9
add upstream 11.9
See merge request opensource-tracking/FreeFileSync!32
Diffstat (limited to 'zenXml/zenxml/cvrt_text.h')
-rw-r--r-- | zenXml/zenxml/cvrt_text.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/zenXml/zenxml/cvrt_text.h b/zenXml/zenxml/cvrt_text.h index 058ffa30..c06a62e0 100644 --- a/zenXml/zenxml/cvrt_text.h +++ b/zenXml/zenxml/cvrt_text.h @@ -118,22 +118,22 @@ public: //Conversion from arbitrary types to text (for use with XML elements and attributes) -enum TextType +enum class TextType { - TEXT_TYPE_BOOL, - TEXT_TYPE_NUMBER, - TEXT_TYPE_CHRONO, - TEXT_TYPE_STRING, - TEXT_TYPE_OTHER, + boolean, + number, + chrono, + string, + other, }; template <class T> struct GetTextType : std::integral_constant<TextType, - std::is_same_v<T, bool> ? TEXT_TYPE_BOOL : - IsStringLikeV<T> ? TEXT_TYPE_STRING : //string before number to correctly handle char/wchar_t -> this was an issue with Loki only! - IsArithmeticV<T> ? TEXT_TYPE_NUMBER : // - IsChronoDuration<T>::value ? TEXT_TYPE_CHRONO : - TEXT_TYPE_OTHER> {}; + std::is_same_v<T, bool> ? TextType::boolean : + IsStringLikeV<T> ? TextType::string : //string before number to correctly handle char/wchar_t -> this was an issue with Loki only! + IsArithmeticV<T> ? TextType::number : // + IsChronoDuration<T>::value ? TextType::chrono : + TextType::other> {}; //###################################################################################### @@ -148,7 +148,7 @@ struct ConvertText; //partial specialization: type bool template <class T> -struct ConvertText<T, TEXT_TYPE_BOOL> +struct ConvertText<T, TextType::boolean> { void writeText(bool value, std::string& output) const { @@ -169,7 +169,7 @@ struct ConvertText<T, TEXT_TYPE_BOOL> //partial specialization: handle conversion for all built-in arithmetic types! template <class T> -struct ConvertText<T, TEXT_TYPE_NUMBER> +struct ConvertText<T, TextType::number> { void writeText(const T& value, std::string& output) const { @@ -183,7 +183,7 @@ struct ConvertText<T, TEXT_TYPE_NUMBER> }; template <class T> -struct ConvertText<T, TEXT_TYPE_CHRONO> +struct ConvertText<T, TextType::chrono> { void writeText(const T& value, std::string& output) const { @@ -198,7 +198,7 @@ struct ConvertText<T, TEXT_TYPE_CHRONO> //partial specialization: handle conversion for all string-like types! template <class T> -struct ConvertText<T, TEXT_TYPE_STRING> +struct ConvertText<T, TextType::string> { void writeText(const T& value, std::string& output) const { @@ -214,7 +214,7 @@ struct ConvertText<T, TEXT_TYPE_STRING> //partial specialization: unknown type template <class T> -struct ConvertText<T, TEXT_TYPE_OTHER> +struct ConvertText<T, TextType::other> { //########################################################################################################################################### static_assert(sizeof(T) == -1); |