Concordia
text_utils.hpp
1 #ifndef TEXT_UTILS_HDR
2 #define TEXT_UTILS_HDR
3 
4 #include <string>
5 #include <boost/shared_ptr.hpp>
6 #include "utf8case/simple_convert.hpp"
7 #include "utf8case/case_converter_factory.hpp"
8 #include "utf8case/string_case_converter_manager.hpp"
9 
12 class TextUtils {
13 public:
17  TextUtils();
18 
21  static TextUtils & getInstance() {
22  static TextUtils instance; // Guaranteed to be destroyed.
23  // Instantiated on first use.
24  return instance;
25  }
26 
31  std::string toLowerCase(const std::string & text);
32 
37  std::string toUpperCase(const std::string & text);
38 
39 private:
40  explicit TextUtils(TextUtils const&); // Don't Implement
41 
42  void operator=(TextUtils const&); // Don't implement
43 
44  boost::shared_ptr<StringGeneralCaseConverter> _lowerConverter;
45 
46  boost::shared_ptr<StringGeneralCaseConverter> _upperConverter;
47 };
48 
49 #endif
TextUtils()
Definition: text_utils.cpp:8
static TextUtils & getInstance()
Definition: text_utils.hpp:21
std::string toLowerCase(const std::string &text)
Definition: text_utils.cpp:15
std::string toUpperCase(const std::string &text)
Definition: text_utils.cpp:22
Definition: text_utils.hpp:12