CppCMS
encoding.h
1 //
3 // Copyright (C) 2008-2012 Artyom Beilis (Tonkikh) <artyomtnk@yahoo.com>
4 //
5 // See accompanying file COPYING.TXT file for licensing details.
6 //
8 #ifndef CPPCMS_ENCODING_H
9 #define CPPCMS_ENCODING_H
10 
11 #include <string>
12 #include <map>
13 #include <locale>
14 #include <cppcms/defs.h>
15 #include <cppcms/config.h>
16 
17 namespace cppcms {
22  namespace encoding {
23 
27 
32  bool CPPCMS_API valid(std::locale const &loc,char const *begin,char const *end,size_t &count);
37  bool CPPCMS_API valid_utf8(char const *begin,char const *end,size_t &count);
42  bool CPPCMS_API valid(char const *encoding,char const *begin,char const *end,size_t &count);
47  bool CPPCMS_API valid(std::string const &encoding,char const *begin,char const *end,size_t &count);
48 
60  bool CPPCMS_API is_ascii_compatible(std::string const &encoding);
69  bool CPPCMS_API validate_or_filter( std::string const &encoding,
70  char const *begin,char const *end,
71  std::string &output,
72  char replace = 0);
73 
78  std::string CPPCMS_API to_utf8(std::locale const &loc,char const *begin,char const *end);
83  std::string CPPCMS_API to_utf8(char const *encoding,char const *begin,char const *end);
88  std::string CPPCMS_API to_utf8(std::locale const &loc,std::string const &str);
93  std::string CPPCMS_API to_utf8(char const *encoding,std::string const &str);
94 
99  std::string CPPCMS_API from_utf8(std::locale const &loc,char const *begin,char const *end);
104  std::string CPPCMS_API from_utf8(char const *encoding,char const *begin,char const *end);
109  std::string CPPCMS_API from_utf8(std::locale const &loc,std::string const &str);
114  std::string CPPCMS_API from_utf8(char const *encoding,std::string const &str);
115 
116  } // encoding
117 } // cppcms
118 
119 
120 #endif
std::string CPPCMS_API from_utf8(std::locale const &loc, char const *begin, char const *end)
bool CPPCMS_API validate_or_filter(std::string const &encoding, char const *begin, char const *end, std::string &output, char replace=0)
This is the namespace where all CppCMS functionality is placed.
Definition: application.h:19
bool CPPCMS_API valid(std::locale const &loc, char const *begin, char const *end, size_t &count)
bool CPPCMS_API is_ascii_compatible(std::string const &encoding)
bool CPPCMS_API valid_utf8(char const *begin, char const *end, size_t &count)
std::string CPPCMS_API to_utf8(std::locale const &loc, char const *begin, char const *end)