2014-04-24 08:36:48 +02:00
|
|
|
#ifndef TEXT_UTILS_HDR
|
|
|
|
#define TEXT_UTILS_HDR
|
|
|
|
|
|
|
|
#include <string>
|
2014-04-24 14:26:35 +02:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include "utf8case/simple_convert.hpp"
|
|
|
|
#include "utf8case/case_converter_factory.hpp"
|
|
|
|
#include "utf8case/string_case_converter_manager.hpp"
|
2014-04-24 08:36:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
/*! Utility class for performing simple string operations.
|
|
|
|
*/
|
|
|
|
class TextUtils {
|
|
|
|
public:
|
2014-04-24 14:26:35 +02:00
|
|
|
TextUtils();
|
|
|
|
|
|
|
|
static TextUtils & getInstance() {
|
|
|
|
static TextUtils instance; // Guaranteed to be destroyed.
|
|
|
|
// Instantiated on first use.
|
|
|
|
return instance;
|
|
|
|
}
|
2014-04-24 08:36:48 +02:00
|
|
|
|
|
|
|
/*! A method for converting all string letters to lower case.
|
|
|
|
\param text input string
|
|
|
|
\returns lower case version of the input string.
|
|
|
|
*/
|
2014-04-24 14:26:35 +02:00
|
|
|
string toLowerCase(const string & text);
|
2014-04-24 08:36:48 +02:00
|
|
|
|
|
|
|
/*! A method for converting all string letters to upper case.
|
|
|
|
\param text input string
|
|
|
|
\returns upper case version of the input string.
|
|
|
|
*/
|
2014-04-24 14:26:35 +02:00
|
|
|
string toUpperCase(const string & text);
|
2014-04-24 08:36:48 +02:00
|
|
|
|
|
|
|
private:
|
2014-04-24 14:26:35 +02:00
|
|
|
TextUtils(TextUtils const&); // Don't Implement
|
|
|
|
|
|
|
|
void operator=(TextUtils const&); // Don't implement
|
2014-04-24 08:36:48 +02:00
|
|
|
|
2014-04-24 14:26:35 +02:00
|
|
|
boost::shared_ptr<StringGeneralCaseConverter> _lowerConverter;
|
|
|
|
|
|
|
|
boost::shared_ptr<StringGeneralCaseConverter> _upperConverter;
|
2014-04-24 08:36:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|