view release on metacpan or search on metacpan
include/boost/regex.hpp
include/boost/regex/concepts.hpp
include/boost/regex/config.hpp
include/boost/regex/config/borland.hpp
include/boost/regex/config/cwchar.hpp
include/boost/regex/icu.hpp
include/boost/regex/mfc.hpp
include/boost/regex/pattern_except.hpp
include/boost/regex/pending/object_cache.hpp
include/boost/regex/pending/static_mutex.hpp
include/boost/regex/pending/unicode_iterator.hpp
include/boost/regex/regex_traits.hpp
include/boost/regex/user.hpp
include/boost/regex/v4/basic_regex.hpp
include/boost/regex/v4/basic_regex_creator.hpp
include/boost/regex/v4/basic_regex_parser.hpp
include/boost/regex/v4/c_regex_traits.hpp
include/boost/regex/v4/char_regex_traits.hpp
include/boost/regex/v4/cpp_regex_traits.hpp
include/boost/regex/v4/cregex.hpp
include/boost/regex/v4/error_type.hpp
include/boost/python/detail/python22_fixed.h view on Meta::CPAN
#include "pyport.h"
#include "pymem.h"
#include "object.h"
#include "objimpl.h"
#include "pydebug.h"
#include "unicodeobject.h"
#include "intobject.h"
#include "longobject.h"
#include "floatobject.h"
#ifndef WITHOUT_COMPLEX
#include "complexobject.h"
#endif
#include "rangeobject.h"
#include "stringobject.h"
#include "bufferobject.h"
#include "tupleobject.h"
include/boost/regex/icu.hpp view on Meta::CPAN
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE icu.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Unicode regular expressions on top of the ICU Library.
*/
#ifndef BOOST_REGEX_ICU_HPP
#define BOOST_REGEX_ICU_HPP
#include <unicode/utypes.h>
#include <unicode/uchar.h>
#include <unicode/coll.h>
#include <boost/regex.hpp>
#include <boost/regex/pending/unicode_iterator.hpp>
#include <boost/mpl/int_fwd.hpp>
#include <bitset>
namespace boost{
namespace re_detail{
//
// Implementation details:
include/boost/regex/icu.hpp view on Meta::CPAN
icu_regex_traits& operator=(const icu_regex_traits&);
//
// define the bitmasks offsets we need for additional character properties:
//
enum{
offset_blank = U_CHAR_CATEGORY_COUNT,
offset_space = U_CHAR_CATEGORY_COUNT+1,
offset_xdigit = U_CHAR_CATEGORY_COUNT+2,
offset_underscore = U_CHAR_CATEGORY_COUNT+3,
offset_unicode = U_CHAR_CATEGORY_COUNT+4,
offset_any = U_CHAR_CATEGORY_COUNT+5,
offset_ascii = U_CHAR_CATEGORY_COUNT+6
};
//
// and now the masks:
//
static const char_class_type mask_blank;
static const char_class_type mask_space;
static const char_class_type mask_xdigit;
static const char_class_type mask_underscore;
static const char_class_type mask_unicode;
static const char_class_type mask_any;
static const char_class_type mask_ascii;
static char_class_type lookup_icu_mask(const ::UChar32* p1, const ::UChar32* p2);
boost::shared_ptr< ::boost::re_detail::icu_regex_traits_implementation> m_pimpl;
};
// types:
typedef basic_regex< ::UChar32, icu_regex_traits> u32regex;
include/boost/regex/icu.hpp view on Meta::CPAN
match_flag_type flags = match_default)
{
std::basic_string<charT> result;
re_detail::string_out_iterator<std::basic_string<charT> > i(result);
u32regex_replace(i, s.begin(), s.end(), e, fmt.c_str(), flags);
return result;
}
namespace re_detail{
class unicode_string_out_iterator
{
UnicodeString* out;
public:
unicode_string_out_iterator(UnicodeString& s) : out(&s) {}
unicode_string_out_iterator& operator++() { return *this; }
unicode_string_out_iterator& operator++(int) { return *this; }
unicode_string_out_iterator& operator*() { return *this; }
unicode_string_out_iterator& operator=(UChar v)
{
*out += v;
return *this;
}
typedef std::ptrdiff_t difference_type;
typedef UChar value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef std::output_iterator_tag iterator_category;
};
}
inline UnicodeString u32regex_replace(const UnicodeString& s,
const u32regex& e,
const UChar* fmt,
match_flag_type flags = match_default)
{
UnicodeString result;
re_detail::unicode_string_out_iterator i(result);
u32regex_replace(i, s.getBuffer(), s.getBuffer()+s.length(), e, fmt, flags);
return result;
}
inline UnicodeString u32regex_replace(const UnicodeString& s,
const u32regex& e,
const UnicodeString& fmt,
match_flag_type flags = match_default)
{
UnicodeString result;
re_detail::unicode_string_out_iterator i(result);
re_detail::do_regex_replace(
re_detail::make_utf32_out(i, static_cast<mpl::int_<2> const*>(0)),
re_detail::make_utf32_seq(s.getBuffer(), s.getBuffer()+s.length(), static_cast<mpl::int_<2> const*>(0)),
e,
re_detail::make_utf32_seq(fmt.getBuffer(), fmt.getBuffer() + fmt.length(), static_cast<mpl::int_<2> const*>(0)),
flags);
return result;
}
} // namespace boost.
include/boost/regex/pending/unicode_iterator.hpp view on Meta::CPAN
* John Maddock
*
* Use, modification and distribution are subject to the
* Boost Software License, Version 1.0. (See accompanying file
* LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
*
*/
/*
* LOCATION: see http://www.boost.org for most recent version.
* FILE unicode_iterator.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Iterator adapters for converting between different Unicode encodings.
*/
/****************************************************************************
Contents:
~~~~~~~~~
1) Read Only, Input Adapters:
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
char_class_upper=1<<3,
char_class_lower=1<<4,
char_class_alpha=1<<5,
char_class_digit=1<<6,
char_class_punct=1<<7,
char_class_xdigit=1<<8,
char_class_alnum=char_class_alpha|char_class_digit,
char_class_graph=char_class_alnum|char_class_punct,
char_class_blank=1<<9,
char_class_word=1<<10,
char_class_unicode=1<<11
};
#endif
//
// class cpp_regex_traits_implementation:
// provides pimpl implementation for cpp_regex_traits.
//
template <class charT>
class cpp_regex_traits_implementation : public cpp_regex_traits_char_layer<charT>
{
public:
typedef typename cpp_regex_traits<charT>::char_class_type char_class_type;
typedef typename std::ctype<charT>::mask native_mask_type;
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
BOOST_STATIC_CONSTANT(char_class_type, mask_blank = 1u << 24);
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 1u << 25);
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 1u << 26);
#endif
typedef std::basic_string<charT> string_type;
typedef charT char_type;
//cpp_regex_traits_implementation();
cpp_regex_traits_implementation(const std::locale& l)
: cpp_regex_traits_char_layer<charT>(l), m_is(&m_sbuf)
{
init();
}
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
};
#ifndef BOOST_REGEX_BUGGY_CTYPE_FACET
#if !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
template <class charT>
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_blank;
template <class charT>
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_word;
template <class charT>
typename cpp_regex_traits_implementation<charT>::char_class_type const cpp_regex_traits_implementation<charT>::mask_unicode;
#endif
#endif
template <class charT>
typename cpp_regex_traits_implementation<charT>::string_type
cpp_regex_traits_implementation<charT>::transform_primary(const charT* p1, const charT* p2) const
{
//
// PRECONDITIONS:
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
std::ctype<charT>::digit,
std::ctype<charT>::graph,
std::ctype<charT>::lower,
std::ctype<charT>::print,
std::ctype<charT>::punct,
std::ctype<charT>::space,
std::ctype<charT>::upper,
std::ctype<charT>::xdigit,
cpp_regex_traits_implementation<charT>::mask_blank,
cpp_regex_traits_implementation<charT>::mask_word,
cpp_regex_traits_implementation<charT>::mask_unicode,
};
#else
static const char_class_type masks[14] =
{
::boost::re_detail::char_class_alnum,
::boost::re_detail::char_class_alpha,
::boost::re_detail::char_class_cntrl,
::boost::re_detail::char_class_digit,
::boost::re_detail::char_class_graph,
::boost::re_detail::char_class_lower,
::boost::re_detail::char_class_print,
::boost::re_detail::char_class_punct,
::boost::re_detail::char_class_space,
::boost::re_detail::char_class_upper,
::boost::re_detail::char_class_xdigit,
::boost::re_detail::char_class_blank,
::boost::re_detail::char_class_word,
::boost::re_detail::char_class_unicode,
};
#endif
static const string_type null_string;
for(unsigned int j = 0; j <= 13; ++j)
{
string_type s(this->m_pmessages->get(cat, 0, j+300, null_string));
if(s.size())
this->m_custom_class_names[s] = masks[j];
}
}
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
std::ctype<char>::digit,
std::ctype<char>::digit,
std::ctype<char>::graph,
std::ctype<char>::lower,
std::ctype<char>::lower,
std::ctype<char>::print,
std::ctype<char>::punct,
std::ctype<char>::space,
std::ctype<char>::space,
std::ctype<char>::upper,
cpp_regex_traits_implementation<charT>::mask_unicode,
std::ctype<char>::upper,
std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
std::ctype<char>::alnum | cpp_regex_traits_implementation<charT>::mask_word,
std::ctype<char>::xdigit,
};
#else
static const char_class_type masks[20] =
{
0,
::boost::re_detail::char_class_alnum,
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
::boost::re_detail::char_class_digit,
::boost::re_detail::char_class_digit,
::boost::re_detail::char_class_graph,
::boost::re_detail::char_class_lower,
::boost::re_detail::char_class_lower,
::boost::re_detail::char_class_print,
::boost::re_detail::char_class_punct,
::boost::re_detail::char_class_space,
::boost::re_detail::char_class_space,
::boost::re_detail::char_class_upper,
::boost::re_detail::char_class_unicode,
::boost::re_detail::char_class_upper,
::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
::boost::re_detail::char_class_alnum | ::boost::re_detail::char_class_word,
::boost::re_detail::char_class_xdigit,
};
#endif
if(m_custom_class_names.size())
{
typedef typename std::map<std::basic_string<charT>, char_class_type>::const_iterator map_iter;
map_iter pos = m_custom_class_names.find(string_type(p1, p2));
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
|| ((mask & ::boost::re_detail::char_class_print) && (m_pctype->is(std::ctype<charT>::print, c)))
|| ((mask & ::boost::re_detail::char_class_cntrl) && (m_pctype->is(std::ctype<charT>::cntrl, c)))
|| ((mask & ::boost::re_detail::char_class_upper) && (m_pctype->is(std::ctype<charT>::upper, c)))
|| ((mask & ::boost::re_detail::char_class_lower) && (m_pctype->is(std::ctype<charT>::lower, c)))
|| ((mask & ::boost::re_detail::char_class_alpha) && (m_pctype->is(std::ctype<charT>::alpha, c)))
|| ((mask & ::boost::re_detail::char_class_digit) && (m_pctype->is(std::ctype<charT>::digit, c)))
|| ((mask & ::boost::re_detail::char_class_punct) && (m_pctype->is(std::ctype<charT>::punct, c)))
|| ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype<charT>::xdigit, c)))
|| ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|| ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
|| ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c));
}
#endif
template <class charT>
boost::shared_ptr<cpp_regex_traits_implementation<charT> > create_cpp_regex_traits(const std::locale& l BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(charT))
{
cpp_regex_traits_base<charT> key(l);
return ::boost::object_cache<cpp_regex_traits_base<charT>, cpp_regex_traits_implementation<charT> >::get(key, 5);
}
include/boost/regex/v4/cpp_regex_traits.hpp view on Meta::CPAN
| std::ctype<charT>::print
| std::ctype<charT>::punct
| std::ctype<charT>::space
| std::ctype<charT>::upper
| std::ctype<charT>::xdigit);
if((f & mask_base)
&& (m_pimpl->m_pctype->is(
static_cast<ctype_mask>(f & mask_base), c)))
return true;
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
return true;
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_word) && (c == '_'))
return true;
else if((f & re_detail::cpp_regex_traits_implementation<charT>::mask_blank)
&& m_pimpl->m_pctype->is(std::ctype<charT>::space, c)
&& !re_detail::is_separator(c))
return true;
return false;
#else
return m_pimpl->isctype(c, f);
include/boost/regex/v4/regex_traits_defaults.hpp view on Meta::CPAN
{data+20, data+21,}, // d
{data+20, data+25,}, // digit
{data+25, data+30,}, // graph
{data+30, data+31,}, // l
{data+30, data+35,}, // lower
{data+35, data+40,}, // print
{data+40, data+45,}, // punct
{data+45, data+46,}, // s
{data+45, data+50,}, // space
{data+57, data+58,}, // u
{data+50, data+57,}, // unicode
{data+57, data+62,}, // upper
{data+62, data+63,}, // w
{data+62, data+66,}, // word
{data+66, data+72,}, // xdigit
};
static const character_pointer_range<charT>* ranges_begin = ranges;
static const character_pointer_range<charT>* ranges_end = ranges + (sizeof(ranges)/sizeof(ranges[0]));
character_pointer_range<charT> t = { p1, p2, };
const character_pointer_range<charT>* p = std::lower_bound(ranges_begin, ranges_end, t);
include/boost/regex/v4/syntax_type.hpp view on Meta::CPAN
static const escape_syntax_type escape_type_word_assert = 18;
static const escape_syntax_type escape_type_not_word_assert = 19;
static const escape_syntax_type escape_type_control_f = 29;
static const escape_syntax_type escape_type_control_n = 30;
static const escape_syntax_type escape_type_control_r = 31;
static const escape_syntax_type escape_type_control_t = 32;
static const escape_syntax_type escape_type_control_v = 33;
static const escape_syntax_type escape_type_ascii_control = 35;
static const escape_syntax_type escape_type_hex = 34;
static const escape_syntax_type escape_type_unicode = 0; // not used
static const escape_syntax_type escape_type_identity = 0; // not used
static const escape_syntax_type escape_type_backref = syntax_digit;
static const escape_syntax_type escape_type_decimal = syntax_digit; // not used
static const escape_syntax_type escape_type_class = 22;
static const escape_syntax_type escape_type_not_class = 23;
// extensions:
static const escape_syntax_type escape_type_left_word = 20;
static const escape_syntax_type escape_type_right_word = 21;
include/boost/regex/v4/w32_regex_traits.hpp view on Meta::CPAN
//
// class w32_regex_traits_implementation:
// provides pimpl implementation for w32_regex_traits.
//
template <class charT>
class w32_regex_traits_implementation : public w32_regex_traits_char_layer<charT>
{
public:
typedef typename w32_regex_traits<charT>::char_class_type char_class_type;
BOOST_STATIC_CONSTANT(char_class_type, mask_word = 0x0400); // must be C1_DEFINED << 1
BOOST_STATIC_CONSTANT(char_class_type, mask_unicode = 0x0800); // must be C1_DEFINED << 2
BOOST_STATIC_CONSTANT(char_class_type, mask_base = 0x3ff); // all the masks used by the CT_CTYPE1 group
typedef std::basic_string<charT> string_type;
typedef charT char_type;
w32_regex_traits_implementation(::boost::re_detail::lcid_type l);
std::string error_string(regex_constants::error_type n) const
{
if(!m_error_strings.empty())
{
std::map<int, std::string>::const_iterator p = m_error_strings.find(n);
include/boost/regex/v4/w32_regex_traits.hpp view on Meta::CPAN
0x0004u, // C1_DIGIT
(~(0x0020u|0x0008u) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE
0x0002u, // C1_LOWER
(~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL
0x0010u, // C1_PUNCT
0x0008u, // C1_SPACE
0x0001u, // C1_UPPER
0x0080u, // C1_XDIGIT
0x0040u, // C1_BLANK
w32_regex_traits_implementation<charT>::mask_word,
w32_regex_traits_implementation<charT>::mask_unicode,
};
static const string_type null_string;
for(unsigned int j = 0; j <= 13; ++j)
{
string_type s(::boost::re_detail::w32_cat_get(cat, this->m_locale, j+300, null_string));
if(s.size())
this->m_custom_class_names[s] = masks[j];
}
}
//
include/boost/regex/v4/w32_regex_traits.hpp view on Meta::CPAN
0x0004u, // C1_DIGIT
0x0004u, // C1_DIGIT
(~(0x0020u|0x0008u|0x0040) & 0x01ffu) | 0x0400u, // not C1_CNTRL or C1_SPACE or C1_BLANK
0x0002u, // C1_LOWER
0x0002u, // C1_LOWER
(~0x0020u & 0x01ffu) | 0x0400, // not C1_CNTRL
0x0010u, // C1_PUNCT
0x0008u, // C1_SPACE
0x0008u, // C1_SPACE
0x0001u, // C1_UPPER
w32_regex_traits_implementation<charT>::mask_unicode,
0x0001u, // C1_UPPER
0x0104u | w32_regex_traits_implementation<charT>::mask_word,
0x0104u | w32_regex_traits_implementation<charT>::mask_word,
0x0080u, // C1_XDIGIT
};
if(m_custom_class_names.size())
{
typedef typename std::map<std::basic_string<charT>, char_class_type>::const_iterator map_iter;
map_iter pos = m_custom_class_names.find(string_type(p1, p2));
if(pos != m_custom_class_names.end())
include/boost/regex/v4/w32_regex_traits.hpp view on Meta::CPAN
}
string_type lookup_collatename(const charT* p1, const charT* p2) const
{
return m_pimpl->lookup_collatename(p1, p2);
}
bool isctype(charT c, char_class_type f) const
{
if((f & re_detail::w32_regex_traits_implementation<charT>::mask_base)
&& (this->m_pimpl->isctype(f & re_detail::w32_regex_traits_implementation<charT>::mask_base, c)))
return true;
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_unicode) && re_detail::is_extended(c))
return true;
else if((f & re_detail::w32_regex_traits_implementation<charT>::mask_word) && (c == '_'))
return true;
return false;
}
int toi(const charT*& p1, const charT* p2, int radix)const
{
return ::boost::re_detail::global_toi(p1, p2, radix, *this);
}
int value(charT c, int radix)const