23 #ifndef _STRING_REGEX_HPP_ 24 #define _STRING_REGEX_HPP_ 36 struct compiled_regex;
37 struct cub_reg_traits;
41 using cub_compiled_regex = cubregex::compiled_regex;
42 using cub_regex_object = std::basic_regex <wchar_t, cubregex::cub_reg_traits>;
43 using cub_regex_iterator = std::regex_iterator<std::wstring::iterator, wchar_t, cubregex::cub_reg_traits>;
44 using cub_regex_results = std::match_results <std::wstring::iterator>;
50 cub_regex_object *regex;
58 struct cub_reg_traits : std::regex_traits<wchar_t>
60 template<
class Iter >
61 string_type lookup_collatename ( Iter first, Iter last )
const 63 throw std::regex_error (std::regex_constants::error_collate);
66 bool isctype ( char_type c, char_class_type f )
const 73 if ((f & std::ctype_base::blank) == 1)
75 return std::iswblank (c);
78 return std::regex_traits<char_type>::isctype (c, f);
82 void clear (cub_regex_object *&compiled_regex,
char *&compiled_pattern);
83 int parse_match_type (std::regex_constants::syntax_option_type ®_flags, std::string &opt_str);
89 const std::string &pattern,
90 const std::regex_constants::syntax_option_type reg_flags);
92 int compile (cub_regex_object *&rx_compiled_regex,
const char *pattern,
93 const std::regex_constants::syntax_option_type reg_flags,
const LANG_COLLATION *collation);
94 int search (
int &result,
const cub_regex_object ®,
const std::string &src,
const INTL_CODESET codeset);
96 int count (
int &result,
const cub_regex_object ®,
const std::string &src,
const int position,
98 int instr (
int &result,
const cub_regex_object ®,
const std::string &src,
99 const int position,
const int occurrence,
const int return_opt,
const INTL_CODESET codeset);
100 int replace (std::string &result,
const cub_regex_object ®,
const std::string &src,
101 const std::string &repl,
const int position,
103 int substr (std::string &result,
bool &is_matched,
const cub_regex_object ®,
const std::string &src,
104 const int position,
const int occurrence,
const INTL_CODESET codeset);
108 #endif // _STRING_REGEX_HPP_ int instr(int &result, const cub_regex_object ®, const std::string &src, const int position, const int occurrence, const int return_opt, const INTL_CODESET codeset)
int compile(cub_regex_object *&compiled_regex, const char *pattern, const std::regex_constants::syntax_option_type reg_flags, const LANG_COLLATION *collation)
int substr(std::string &result, bool &is_matched, const cub_regex_object ®, const std::string &src, const int position, const int occurrence, const INTL_CODESET codeset)
int count(int &result, const cub_regex_object ®, const std::string &src, const int position, const INTL_CODESET codeset)
int parse_match_type(std::regex_constants::syntax_option_type ®_flags, std::string &opt_str)
int replace(std::string &result, const cub_regex_object ®, const std::string &src, const std::string &repl, const int position, const int occurrence, const INTL_CODESET codeset)
enum intl_codeset INTL_CODESET
std::string parse_regex_exception(std::regex_error &e)
bool check_should_recompile(const cub_regex_object *compiled_regex, const char *compiled_pattern, const std::string &pattern, const std::regex_constants::syntax_option_type reg_flags)
int search(int &result, const cub_regex_object ®, const std::string &src, const INTL_CODESET codeset)
void clear(cub_regex_object *®ex, char *&pattern)