diff --git a/owlps-positioning/src/posutil.hh b/owlps-positioning/src/posutil.hh index 22d1cbd..8e56ebb 100644 --- a/owlps-positioning/src/posutil.hh +++ b/owlps-positioning/src/posutil.hh @@ -4,6 +4,7 @@ class Measurement ; #include +#include /// Utilitary class class PosUtil @@ -29,6 +30,34 @@ public: /// Converts a Wi-Fi channel to the corresponding frequency in Hz static unsigned long wifi_channel_to_hz(const unsigned long &channel) ; //@} + + /** @name Strings */ + //@{ + static void to_upper(std::string &str) ; + static void assert_uppercase(const std::string &str) ; + //@} } ; + + +/* *** Strings *** */ + + +inline void PosUtil::to_upper(std::string &str) +{ + boost::to_upper(str) ; +} + + +inline void PosUtil::assert_uppercase(const std::string &str) +{ +#ifndef NDEBUG + std::string str_up(str) ; + to_upper(str_up) ; + assert(str_up == str) ; +#endif // NDEBUG +} + + + #endif // _OWLPS_POSITIONING_POSUTIL_HH_