summaryrefslogtreecommitdiff
path: root/zenXml/zenxml/cvrt_text.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2021-04-05 11:02:07 -0400
committerB Stack <bgstack15@gmail.com>2021-04-05 11:02:07 -0400
commit74361d859354e4416285cd803b1b0075be1fe514 (patch)
treedafb5e266c513a5ed9863401e62d246742861e0c /zenXml/zenxml/cvrt_text.h
parentMerge branch '11.7' into 'master' (diff)
downloadFreeFileSync-74361d859354e4416285cd803b1b0075be1fe514.tar.gz
FreeFileSync-74361d859354e4416285cd803b1b0075be1fe514.tar.bz2
FreeFileSync-74361d859354e4416285cd803b1b0075be1fe514.zip
add upstream 11.9
Diffstat (limited to 'zenXml/zenxml/cvrt_text.h')
-rw-r--r--zenXml/zenxml/cvrt_text.h32
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);
bgstack15