diff --git a/utility/convert.hpp b/utility/convert.hpp index a45c4a718..fcf8e03a8 100644 --- a/utility/convert.hpp +++ b/utility/convert.hpp @@ -52,35 +52,43 @@ struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type { }; template <> -struct ConvertionAllowed : std::true_type +struct ConvertionAllowed : std::true_type +{ +}; +template <> +struct ConvertionAllowed : std::true_type +{ +}; +template <> +struct ConvertionAllowed : std::true_type { }; template <> @@ -98,11 +106,11 @@ struct ConvertionAllowedVia : std::false_type { }; template <> -struct ConvertionAllowedVia : std::true_type +struct ConvertionAllowedVia : std::true_type { }; template <> -struct ConvertionAllowedVia : std::true_type +struct ConvertionAllowedVia : std::true_type { }; @@ -191,16 +199,16 @@ static inline bool convertTo(const std::string &str, T &result) return details::convertTo(str, result); } -/** Specialization for uint8_t of convertTo template function. +/** Specialization for unsigned char of convertTo template function. * * This function follows the same paradigm than it's generic version. * - * The generic version was converting int8 as it was a character - * (uint8_t is an alias to unsigned char on most compiler). + * The generic version was converting char as it was a character + * (unsigned char is an alias to unsigned char on most compiler). * Thus converting "1" would return 49 ie '1'. * As convertTo is thought as an _numerical_ convertion tool * (contrary to boost::lexical_cast for example), - * forbid considering the input as a character and consider uint8_t + * forbid considering the input as a character and consider unsigned char * (aka unsigned char) as a number exclusively. * * @param[in] str the string to parse. @@ -209,21 +217,20 @@ static inline bool convertTo(const std::string &str, T &result) * @return true if conversion was successful, false otherwise. */ template <> -inline bool convertTo(const std::string &str, uint8_t &result) +inline bool convertTo(const std::string &str, unsigned char &result) { - return details::convertToVia(str, result); + return details::convertToVia(str, result); } -/** Specialization for int8_t of convertTo template function. +/** Specialization for signed char of convertTo template function. * - * @see convertTo + * @see convertTo */ template <> -inline bool convertTo(const std::string &str, int8_t &result) +inline bool convertTo(const std::string &str, signed char &result) { - return details::convertToVia(str, result); + return details::convertToVia(str, result); } - /** * Specialization for float of convertTo template function. * diff --git a/xmlserializer/XmlElement.cpp b/xmlserializer/XmlElement.cpp index c54d97e70..902d0d966 100644 --- a/xmlserializer/XmlElement.cpp +++ b/xmlserializer/XmlElement.cpp @@ -265,17 +265,27 @@ bool CXmlElement::CChildIterator::next(CXmlElement &xmlChildElement) } template bool CXmlElement::getAttribute(const std::string &name, std::string &value) const; -template bool CXmlElement::getAttribute(const std::string &name, uint16_t &value) const; -template bool CXmlElement::getAttribute(const std::string &name, uint32_t &value) const; -template bool CXmlElement::getAttribute(const std::string &name, int32_t &value) const; -template bool CXmlElement::getAttribute(const std::string &name, uint64_t &value) const; template bool CXmlElement::getAttribute(const std::string &name, bool &value) const; -template bool CXmlElement::getAttribute(const std::string &name, double &value) const; +template bool CXmlElement::getAttribute(const std::string &name, short &value) const; +template bool CXmlElement::getAttribute(const std::string &name, unsigned short &value) const; +template bool CXmlElement::getAttribute(const std::string &name, int &value) const; +template bool CXmlElement::getAttribute(const std::string &name, unsigned int &value) const; +template bool CXmlElement::getAttribute(const std::string &name, long &value) const; +template bool CXmlElement::getAttribute(const std::string &name, unsigned long &value) const; +template bool CXmlElement::getAttribute(const std::string &name, long long &value) const; +template bool CXmlElement::getAttribute(const std::string &name, unsigned long long &value) const; template bool CXmlElement::getAttribute(const std::string &name, float &value) const; +template bool CXmlElement::getAttribute(const std::string &name, double &value) const; template void CXmlElement::setAttribute(const std::string &name, const std::string &value); template void CXmlElement::setAttribute(const std::string &name, const bool &value); -template void CXmlElement::setAttribute(const std::string &name, const int32_t &value); -template void CXmlElement::setAttribute(const std::string &name, const uint32_t &value); -template void CXmlElement::setAttribute(const std::string &name, const uint64_t &value); +template void CXmlElement::setAttribute(const std::string &name, const short &value); +template void CXmlElement::setAttribute(const std::string &name, const unsigned short &value); +template void CXmlElement::setAttribute(const std::string &name, const int &value); +template void CXmlElement::setAttribute(const std::string &name, const unsigned int &value); +template void CXmlElement::setAttribute(const std::string &name, const long &value); +template void CXmlElement::setAttribute(const std::string &name, const unsigned long &value); +template void CXmlElement::setAttribute(const std::string &name, const long long &value); +template void CXmlElement::setAttribute(const std::string &name, const unsigned long long &value); template void CXmlElement::setAttribute(const std::string &name, const float &value); +template void CXmlElement::setAttribute(const std::string &name, const double &value);