diff options
Diffstat (limited to '3rdParty/CppUnit/src/include/cppunit/tools')
3 files changed, 50 insertions, 5 deletions
diff --git a/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h b/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h new file mode 100644 index 0000000..3301045 --- /dev/null +++ b/3rdParty/CppUnit/src/include/cppunit/tools/StringHelper.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #ifndef CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 2 | #define CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 3 | |||
| 4 | #include <cppunit/Portability.h> | ||
| 5 | #include <cppunit/portability/Stream.h> | ||
| 6 | #include <string> | ||
| 7 | #include <type_traits> | ||
| 8 | |||
| 9 | |||
| 10 | CPPUNIT_NS_BEGIN | ||
| 11 | |||
| 12 | |||
| 13 | /*! \brief Methods for converting values to strings. Replaces CPPUNIT_NS::StringTools::toString | ||
| 14 | */ | ||
| 15 | namespace StringHelper | ||
| 16 | { | ||
| 17 | |||
| 18 | // work around to handle C++11 enum class correctly. We need an own conversion to std::string | ||
| 19 | // as there is no implicit coversion to int for enum class. | ||
| 20 | |||
| 21 | template<typename T> | ||
| 22 | typename std::enable_if<!std::is_enum<T>::value, std::string>::type toString(const T& x) | ||
| 23 | { | ||
| 24 | OStringStream ost; | ||
| 25 | ost << x; | ||
| 26 | |||
| 27 | return ost.str(); | ||
| 28 | } | ||
| 29 | |||
| 30 | template<typename T> | ||
| 31 | typename std::enable_if<std::is_enum<T>::value, std::string>::type toString(const T& x) | ||
| 32 | { | ||
| 33 | OStringStream ost; | ||
| 34 | ost << static_cast<typename std::underlying_type<T>::type>(x); | ||
| 35 | |||
| 36 | return ost.str(); | ||
| 37 | } | ||
| 38 | |||
| 39 | } | ||
| 40 | |||
| 41 | |||
| 42 | CPPUNIT_NS_END | ||
| 43 | |||
| 44 | #endif // CPPUNIT_TOOLS_STRINGHELPER_H | ||
| 45 | |||
diff --git a/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h b/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h index 7a6b6d7..d08c6e0 100644 --- a/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h +++ b/3rdParty/CppUnit/src/include/cppunit/tools/StringTools.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <cppunit/Portability.h> | 4 | #include <cppunit/Portability.h> |
| 5 | #include <string> | 5 | #include <string> |
| 6 | #include <cppunit/portability/CppUnitVector.h> | 6 | #include <vector> |
| 7 | 7 | ||
| 8 | 8 | ||
| 9 | CPPUNIT_NS_BEGIN | 9 | CPPUNIT_NS_BEGIN |
| @@ -14,7 +14,7 @@ CPPUNIT_NS_BEGIN | |||
| 14 | struct StringTools | 14 | struct StringTools |
| 15 | { | 15 | { |
| 16 | 16 | ||
| 17 | typedef CppUnitVector<std::string> Strings; | 17 | typedef std::vector<std::string> Strings; |
| 18 | 18 | ||
| 19 | static std::string CPPUNIT_API toString( int value ); | 19 | static std::string CPPUNIT_API toString( int value ); |
| 20 | 20 | ||
diff --git a/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h b/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h index 0b36bd2..70e21f8 100644 --- a/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h +++ b/3rdParty/CppUnit/src/include/cppunit/tools/XmlElement.h | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z | 8 | #pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z |
| 9 | #endif | 9 | #endif |
| 10 | 10 | ||
| 11 | #include <cppunit/portability/CppUnitDeque.h> | 11 | #include <deque> |
| 12 | #include <string> | 12 | #include <string> |
| 13 | 13 | ||
| 14 | 14 | ||
| @@ -131,10 +131,10 @@ private: | |||
| 131 | std::string m_name; | 131 | std::string m_name; |
| 132 | std::string m_content; | 132 | std::string m_content; |
| 133 | 133 | ||
| 134 | typedef CppUnitDeque<Attribute> Attributes; | 134 | typedef std::deque<Attribute> Attributes; |
| 135 | Attributes m_attributes; | 135 | Attributes m_attributes; |
| 136 | 136 | ||
| 137 | typedef CppUnitDeque<XmlElement *> Elements; | 137 | typedef std::deque<XmlElement *> Elements; |
| 138 | Elements m_elements; | 138 | Elements m_elements; |
| 139 | }; | 139 | }; |
| 140 | 140 | ||
Swift