commit of split-config, including any changes required to existing libraries (mainly regex).

[SVN r11138]
This commit is contained in:
John Maddock
2001-09-18 11:13:39 +00:00
parent 1be8e9241b
commit 1d473147fd
71 changed files with 2568 additions and 7142 deletions

View File

@ -25,25 +25,25 @@
#ifndef BOOST_RE_FILEITER_HPP
#define BOOST_RE_FILEITER_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(BOOST_RE_NO_W32)
#if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && !defined(BOOST_REGEX_NO_W32)
#error "Sorry, can't mix <windows.h> with STL code and gcc compiler: if you ran configure, try again with configure --disable-ms-windows"
#define FI_WIN32_MAP
#define FI_POSIX_DIR
#elif (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) && !defined(BOOST_RE_NO_W32)
#define FI_WIN32_MAP
#define FI_WIN32_DIR
#define BOOST_REGEX_FI_WIN32_MAP
#define BOOST_REGEX_FI_POSIX_DIR
#elif (defined(__WIN32__) || defined(_WIN32) || defined(WIN32)) && !defined(BOOST_REGEX_NO_W32)
#define BOOST_REGEX_FI_WIN32_MAP
#define BOOST_REGEX_FI_WIN32_DIR
#else
#define FI_POSIX_MAP
#define FI_POSIX_DIR
#define BOOST_REGEX_FI_POSIX_MAP
#define BOOST_REGEX_FI_POSIX_DIR
#endif
#if defined(FI_WIN32_MAP)||defined(FI_WIN32_DIR)
#if defined(BOOST_REGEX_FI_WIN32_MAP)||defined(BOOST_REGEX_FI_WIN32_DIR)
#include <windows.h>
#endif
#if defined(FI_WIN32_DIR)
#if defined(BOOST_REGEX_FI_WIN32_DIR)
namespace boost{
namespace re_detail{
@ -58,7 +58,7 @@ typedef HANDLE _fi_find_handle;
#define _fi_invalid_handle INVALID_HANDLE_VALUE
#define _fi_dir FILE_ATTRIBUTE_DIRECTORY
#elif defined(FI_POSIX_DIR)
#elif defined(BOOST_REGEX_FI_POSIX_DIR)
#include <cstdio>
#include <cctype>
@ -134,9 +134,9 @@ namespace boost{
#endif
#endif
#ifdef FI_WIN32_MAP // win32 mapfile
#ifdef BOOST_REGEX_FI_WIN32_MAP // win32 mapfile
class BOOST_RE_IX_DECL mapfile
class BOOST_REGEX_DECL mapfile
{
HANDLE hfile;
HANDLE hmap;
@ -158,11 +158,11 @@ public:
};
#elif !defined(BOOST_RE_NO_STL) // use C API to emulate the memory map:
#else
class BOOST_RE_IX_DECL mapfile_iterator;
class BOOST_REGEX_DECL mapfile_iterator;
class BOOST_RE_IX_DECL mapfile
class BOOST_REGEX_DECL mapfile
{
typedef char* pointer;
std::FILE* hfile;
@ -192,7 +192,7 @@ public:
friend class mapfile_iterator;
};
class BOOST_RE_IX_DECL mapfile_iterator
class BOOST_REGEX_DECL mapfile_iterator
{
typedef mapfile::pointer internal_pointer;
internal_pointer* node;
@ -272,12 +272,12 @@ public:
{
return (i.file == j.file) && (i.node == j.node) && (i.offset == j.offset);
}
#ifndef BOOST_RE_NO_NOT_EQUAL
friend inline bool operator!=(const mapfile_iterator& i, const mapfile_iterator& j)
{
return !(i == j);
}
#endif
friend inline bool operator<(const mapfile_iterator& i, const mapfile_iterator& j)
{
return i.position() < j.position();
@ -311,7 +311,7 @@ public:
#endif
// _fi_sep determines the directory separator, either '\\' or '/'
BOOST_RE_IX_DECL extern const char* _fi_sep;
BOOST_REGEX_DECL extern const char* _fi_sep;
struct file_iterator_ref
{
@ -321,7 +321,7 @@ struct file_iterator_ref
};
class BOOST_RE_IX_DECL file_iterator
class BOOST_REGEX_DECL file_iterator
{
char* _root;
char* _path;
@ -353,12 +353,12 @@ public:
{
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
}
#ifndef BOOST_RE_NO_NOT_EQUAL
friend inline bool operator != (const file_iterator& f1, const file_iterator& f2)
{
return !(f1 == f2);
}
#endif
};
// dwa 9/13/00 - suppress unused parameter warning
@ -368,7 +368,7 @@ inline bool operator < (const file_iterator&, const file_iterator&)
}
class BOOST_RE_IX_DECL directory_iterator
class BOOST_REGEX_DECL directory_iterator
{
char* _root;
char* _path;
@ -404,13 +404,13 @@ public:
return ((f1.ref->hf == _fi_invalid_handle) && (f2.ref->hf == _fi_invalid_handle));
}
#ifndef BOOST_RE_NO_NOT_EQUAL
friend inline bool operator != (const directory_iterator& f1, const directory_iterator& f2)
{
return !(f1 == f2);
}
#endif
};
};
inline bool operator < (const directory_iterator&, const directory_iterator&)
{

View File

@ -46,7 +46,7 @@ struct kmp_translator
template <class charT, class traits_type, class Allocator>
bool BOOST_RE_CALL re_maybe_set_member(charT c,
bool BOOST_REGEX_CALL re_maybe_set_member(charT c,
re_set_long* set_,
const reg_expression<charT, traits_type, Allocator>& e)
{
@ -66,7 +66,7 @@ bool BOOST_RE_CALL re_maybe_set_member(charT c,
} // namespace re_detail
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
//
// Ugly ugly hack,
// templates don't merge if they contain switch statements so declare these
@ -76,41 +76,41 @@ namespace{
#endif
template <class charT, class traits, class Allocator>
inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&)
inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_wide_type&)
{
if((traits_size_type)(traits_uchar_type)c >= 256)
return true;
return BOOST_RE_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
}
template <class charT, class traits, class Allocator>
inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&)
inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::can_start(charT c, const unsigned char* _map, unsigned char mask, const re_detail::_narrow_type&)
{
return BOOST_RE_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
return BOOST_REGEX_MAKE_BOOL(_map[(traits_uchar_type)c] & mask);
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
reg_expression<charT, traits, Allocator>::reg_expression(const Allocator& a)
: regbase(), data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p, f | regbase::use_except);
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
reg_expression<charT, traits, Allocator>::reg_expression(const charT* p1, const charT* p2, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p1, p2, f | regbase::use_except);
}
template <class charT, class traits, class Allocator>
CONSTRUCTOR_INLINE reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
reg_expression<charT, traits, Allocator>::reg_expression(const charT* p, size_type len, flag_type f, const Allocator& a)
: data(a), pkmp(0), error_code_(REG_EMPTY), _expression(0)
{
set_expression(p, p + len, f | regbase::use_except);
@ -143,7 +143,7 @@ reg_expression<charT, traits, Allocator>::~reg_expression()
}
template <class charT, class traits, class Allocator>
reg_expression<charT, traits, Allocator>& BOOST_RE_CALL reg_expression<charT, traits, Allocator>::operator=(const reg_expression<charT, traits, Allocator>& e)
reg_expression<charT, traits, Allocator>& BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator=(const reg_expression<charT, traits, Allocator>& e)
{
//
// we do a deep copy only if e is a valid expression, otherwise fail.
@ -157,7 +157,7 @@ reg_expression<charT, traits, Allocator>& BOOST_RE_CALL reg_expression<charT, tr
}
template <class charT, class traits, class Allocator>
inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::operator==(const reg_expression<charT, traits, Allocator>& e)const
inline bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator==(const reg_expression<charT, traits, Allocator>& e)const
{
return (_flags == e.flags())
&& (_expression_len == e._expression_len)
@ -165,7 +165,7 @@ inline bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::operator==(c
}
template <class charT, class traits, class Allocator>
bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::operator<(const reg_expression<charT, traits, Allocator>& e)const
bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::operator<(const reg_expression<charT, traits, Allocator>& e)const
{
//
// we can't offer a diffinitive ordering, but we can be consistant:
@ -175,19 +175,19 @@ bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::operator<(const reg
}
template <class charT, class traits, class Allocator>
Allocator BOOST_RE_CALL reg_expression<charT, traits, Allocator>::allocator()const
Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::allocator()const
{
return data.allocator();
}
template <class charT, class traits, class Allocator>
Allocator BOOST_RE_CALL reg_expression<charT, traits, Allocator>::get_allocator()const
Allocator BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::get_allocator()const
{
return data.allocator();
}
template <class charT, class traits, class Allocator>
unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& first, const charT* last)
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_inner_set(const charT*& first, const charT* last)
{
//
// we have an inner [...] construct
@ -214,7 +214,7 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_inner
template <class charT, class traits, class Allocator>
bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& first, const charT* last)
bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::skip_space(const charT*& first, const charT* last)
{
//
// returns true if we get to last:
@ -227,7 +227,7 @@ bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::skip_space(const ch
}
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* end, unsigned& min, unsigned& max)
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_range(const charT*& ptr, const charT* end, unsigned& min, unsigned& max)
{
//
// we have {x} or {x,} or {x,y} NB no spaces inside braces
@ -305,7 +305,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_range(const c
}
template <class charT, class traits, class Allocator>
charT BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& first, const charT* last)
charT BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::parse_escape(const charT*& first, const charT* last)
{
charT c(*first);
traits_size_type c_unsigned = (traits_size_type)(traits_uchar_type)*first;
@ -408,7 +408,7 @@ charT BOOST_RE_CALL reg_expression<charT, traits, Allocator>::parse_escape(const
}
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_maps()
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_maps()
{
re_detail::re_syntax_base* record = (re_detail::re_syntax_base*)data.data();
// always compile the first _map:
@ -436,7 +436,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_maps()
}
template <class charT, class traits, class Allocator>
bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_start(
bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start(
re_detail::re_syntax_base* node, charT cc, re_detail::re_syntax_base* terminal) const
{
unsigned int c;
@ -541,7 +541,7 @@ bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_start(
}
template <class charT, class traits, class Allocator>
bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const
bool BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_start_null(re_detail::re_syntax_base* node, re_detail::re_syntax_base* terminal)const
{
switch(node->type)
{
@ -590,7 +590,7 @@ bool BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_start_null(re
}
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_map(
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_map(
re_detail::re_syntax_base* node, unsigned char* _map,
unsigned int* pnull, unsigned char mask, re_detail::re_syntax_base* terminal)const
{
@ -607,7 +607,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_map(
}
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned size)
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_detail::re_syntax_base* j, unsigned size)
{
// move all offsets starting with j->link forward by size
// called after an insert:
@ -636,7 +636,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::move_offsets(re_det
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_simple(re_detail::re_syntax_base* dat, unsigned long cls, bool isnot)
{
re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
@ -652,7 +652,7 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& first, const charT* last)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set(const charT*& first, const charT* last)
{
re_detail::jstack<traits_string_type, Allocator> singles(64, data.allocator());
re_detail::jstack<traits_string_type, Allocator> ranges(64, data.allocator());
@ -969,7 +969,7 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_wide_type&)
{
size_type base = data.size();
data.extend(sizeof(re_detail::re_set_long));
@ -1048,7 +1048,7 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::compile_set_aux(re_detail::jstack<traits_string_type, Allocator>& singles, re_detail::jstack<traits_string_type, Allocator>& ranges, re_detail::jstack<boost::uint_fast32_t, Allocator>& classes, re_detail::jstack<traits_string_type, Allocator>& equivalents, bool isnot, const re_detail::_narrow_type&)
{
re_detail::re_set* dat = (re_detail::re_set*)data.extend(sizeof(re_detail::re_set));
std::memset(dat, 0, sizeof(re_detail::re_set));
@ -1153,9 +1153,9 @@ inline
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces)
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_detail::re_syntax_base* b, unsigned cbraces)
{
typedef typename boost::re_detail::rebind_allocator<bool, Allocator>::type b_alloc;
typedef typename boost::detail::rebind_allocator<bool, Allocator>::type b_alloc;
register unsigned char* base = (unsigned char*)b;
register re_detail::re_syntax_base* ptr = b;
@ -1175,7 +1175,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_deta
{
case re_detail::syntax_element_rep:
((re_detail::re_jump*)ptr)->alt.p = add_offset(base, ((re_detail::re_jump*)ptr)->alt.i);
#ifdef BOOST_RE_DEBUG
#ifdef BOOST_REGEX_DEBUG
if((re_detail::padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p) && (((re_detail::re_jump*)ptr)->alt.p != b))
{
jm_trace("padding mis-aligment in repeat jump to object type: " << ((re_detail::re_jump*)ptr)->alt.p->type)
@ -1188,7 +1188,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_deta
case re_detail::syntax_element_jump:
case re_detail::syntax_element_alt:
((re_detail::re_jump*)ptr)->alt.p = add_offset(base, ((re_detail::re_jump*)ptr)->alt.i);
#ifdef BOOST_RE_DEBUG
#ifdef BOOST_REGEX_DEBUG
if((re_detail::padding_mask & (int)((re_detail::re_jump*)ptr)->alt.p) && (((re_detail::re_jump*)ptr)->alt.p != b))
{
jm_trace("padding mis-aligment in alternation jump to object type: " << ((re_detail::re_jump*)ptr)->alt.p->type)
@ -1210,7 +1210,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_deta
default:
rebase:
ptr->next.p = add_offset(base, ptr->next.i);
#ifdef BOOST_RE_DEBUG
#ifdef BOOST_REGEX_DEBUG
if((re_detail::padding_mask & (int)(ptr->next.p)) && (((re_detail::re_jump*)ptr)->alt.p != b))
{
jm_trace("padding mis-alignment in next record of type " << ptr->next.p->type)
@ -1233,7 +1233,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_apply(re_deta
template <class charT, class traits, class Allocator>
unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* p, const charT* end, flag_type f)
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::set_expression(const charT* p, const charT* end, flag_type f)
{
if(p == expression())
{
@ -1883,7 +1883,7 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::set_express
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_simple(re_detail::re_syntax_base* dat, re_detail::syntax_element_type type, unsigned int size)
{
if(dat)
{
@ -1899,7 +1899,7 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator
}
template <class charT, class traits, class Allocator>
re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator>::add_literal(re_detail::re_syntax_base* dat, charT c)
re_detail::re_syntax_base* BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::add_literal(re_detail::re_syntax_base* dat, charT c)
{
if(dat && (dat->type == re_detail::syntax_element_literal))
{
@ -1920,7 +1920,7 @@ re_detail::re_syntax_base* BOOST_RE_CALL reg_expression<charT, traits, Allocator
}
template <class charT, class traits, class Allocator>
unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_restart(re_detail::re_syntax_base* dat)
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::probe_restart(re_detail::re_syntax_base* dat)
{
switch(dat->type)
{
@ -1941,7 +1941,7 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::probe_resta
}
template <class charT, class traits, class Allocator>
unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end)
unsigned int BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fixup_leading_rep(re_detail::re_syntax_base* dat, re_detail::re_syntax_base* end)
{
unsigned int len = 0;
bool leading_lit = end ? false : true;
@ -2015,7 +2015,7 @@ unsigned int BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fixup_leadi
}
template <class charT, class traits, class Allocator>
void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fail(unsigned int err)
void BOOST_REGEX_CALL reg_expression<charT, traits, Allocator>::fail(unsigned int err)
{
error_code_ = err;
if(err)
@ -2031,7 +2031,7 @@ void BOOST_RE_CALL reg_expression<charT, traits, Allocator>::fail(unsigned int e
}
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
} // namespace
#endif

File diff suppressed because it is too large Load Diff

View File

@ -26,7 +26,7 @@
#define BOOST_REGEX_CSTRING_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#endif
#include <cstring>
@ -43,7 +43,7 @@ namespace boost{
//
template <class charT>
std::size_t BOOST_RE_CALL re_strlen(const charT *s)
std::size_t BOOST_REGEX_CALL re_strlen(const charT *s)
{
std::size_t len = 0;
while(*s)
@ -54,27 +54,27 @@ std::size_t BOOST_RE_CALL re_strlen(const charT *s)
return len;
}
inline std::size_t BOOST_RE_CALL re_strlen(const char *s)
inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s)
{
return std::strlen(s);
}
#ifndef BOOST_RE_NO_WCSTRING
#ifndef BOOST_NO_WREGEX
inline std::size_t BOOST_RE_CALL re_strlen(const wchar_t *s)
inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s)
{
return std::wcslen(s);
}
#endif
#ifndef BOOST_RE_NO_WCSTRING
BOOST_RE_IX_DECL void BOOST_RE_CALL re_transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
#ifndef BOOST_NO_WREGEX
BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::basic_string<wchar_t>& out, const std::basic_string<wchar_t>& in);
#endif
BOOST_RE_IX_DECL void BOOST_RE_CALL re_transform(std::string& out, const std::string& in);
BOOST_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in);
template <class charT>
void BOOST_RE_CALL re_trunc_primary(std::basic_string<charT>& s)
void BOOST_REGEX_CALL re_trunc_primary(std::basic_string<charT>& s)
{
for(unsigned int i = 0; i < s.size(); ++i)
{
@ -86,7 +86,7 @@ void BOOST_RE_CALL re_trunc_primary(std::basic_string<charT>& s)
}
}
inline char* BOOST_RE_CALL re_strcpy(char *s1, const char *s2)
inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2)
{
#if defined(__BORLANDC__) && defined(strcpy)
return ::strcpy(s1, s2);
@ -95,9 +95,9 @@ inline char* BOOST_RE_CALL re_strcpy(char *s1, const char *s2)
#endif
}
#ifndef BOOST_RE_NO_WCSTRING
#ifndef BOOST_NO_WREGEX
inline wchar_t* BOOST_RE_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
{
return std::wcscpy(s1, s2);
}
@ -106,7 +106,7 @@ inline wchar_t* BOOST_RE_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
template <class charT>
charT* BOOST_RE_CALL re_strdup(const charT* p)
charT* BOOST_REGEX_CALL re_strdup(const charT* p)
{
charT* buf = new charT[re_strlen(p) + 1];
re_strcpy(buf, p);
@ -114,7 +114,7 @@ charT* BOOST_RE_CALL re_strdup(const charT* p)
}
template <class charT>
inline void BOOST_RE_CALL re_strfree(charT* p)
inline void BOOST_REGEX_CALL re_strfree(charT* p)
{
delete[] p;
}

View File

@ -40,11 +40,11 @@ enum format_flags_t{
namespace re_detail{
#ifdef __BORLANDC__
#pragma option push -a4 -b -Ve -pc
#pragma option push -a4 -b -Ve -pc -w-8037
#endif
template <class O, class I>
O BOOST_RE_CALL re_copy_out(O out, I first, I last)
O BOOST_REGEX_CALL re_copy_out(O out, I first, I last)
{
while(first != last)
{
@ -56,7 +56,7 @@ O BOOST_RE_CALL re_copy_out(O out, I first, I last)
}
template <class charT, class traits_type>
void BOOST_RE_CALL re_skip_format(const charT*& fmt, const traits_type& traits_inst)
void BOOST_REGEX_CALL re_skip_format(const charT*& fmt, const traits_type& traits_inst)
{
// dwa 9/13/00 - suppress incorrect unused parameter warning for MSVC
(void)traits_inst;
@ -96,7 +96,7 @@ void BOOST_RE_CALL re_skip_format(const charT*& fmt, const traits_type& traits_i
}
}
#ifdef BOOST_RE_NO_OI_ASSIGN
#ifdef BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN
//
// ugly hack for buggy output iterators
@ -104,8 +104,8 @@ void BOOST_RE_CALL re_skip_format(const charT*& fmt, const traits_type& traits_i
template <class T>
inline void oi_assign(T* p, T v)
{
jm_destroy(p);
jm_construct(p, v);
::boost::re_detail::destroy(p);
construct(p, v);
}
#else
@ -116,15 +116,15 @@ inline void oi_assign(T* p, T v)
//
// if you get a compile time error in here then you either
// need to rewrite your output iterator to make it assignable
// (as is required by the standard), or define BOOST_RE_NO_OI_ASSIGN
// to use the ugly hack above
// (as is required by the standard), or define
// BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN to use the ugly hack above
*p = v;
}
#endif
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
//
// Ugly ugly hack,
// template don't merge if they contain switch statements so declare these
@ -141,7 +141,7 @@ namespace{
// _reg_format_aux does the actual work:
//
template <class OutputIterator, class iterator, class Allocator, class charT, class traits_type>
OutputIterator BOOST_RE_CALL _reg_format_aux(OutputIterator out,
OutputIterator BOOST_REGEX_CALL _reg_format_aux(OutputIterator out,
const match_results<iterator, Allocator>& m,
const charT*& fmt,
unsigned flags, const traits_type& traits_inst)
@ -428,7 +428,7 @@ default_opt:
return out;
}
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
} // namespace
#endif
@ -462,7 +462,7 @@ public:
: out(&o), last(&pi), fmt(f), flags(format_flags), pt(&p){}
~merge_out_predicate() {}
bool BOOST_RE_CALL operator()(const boost::match_results<iterator, Allocator>& m)
bool BOOST_REGEX_CALL operator()(const boost::match_results<iterator, Allocator>& m)
{
const charT* f = fmt;
if(0 == (flags & format_no_copy))

View File

@ -26,7 +26,7 @@
#define BOOST_REGEX_KMP_HPP
#ifdef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#endif
@ -49,14 +49,14 @@ struct kmp_info
template <class charT, class Allocator>
void kmp_free(kmp_info<charT>* pinfo, const Allocator& a)
{
typedef typename boost::re_detail::rebind_allocator<char, Allocator>::type atype;
typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
atype(a).deallocate((char*)pinfo, pinfo->size);
}
template <class iterator, class charT, class Trans, class Allocator>
kmp_info<charT>* kmp_compile(iterator first, iterator last, charT, Trans translate, const Allocator& a)
{
typedef typename boost::re_detail::rebind_allocator<char, Allocator>::type atype;
typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
int i, j, m;
i = 0;
m = boost::re_detail::distance(first, last);

View File

@ -25,9 +25,9 @@
#ifndef BOOST_REGEX_LIBRARY_INCLUDE_HPP
#define BOOST_REGEX_LIBRARY_INCLUDE_HPP
#ifndef BOOST_RE_NO_LIB
#ifndef BOOST_REGEX_NO_LIB
#if defined(BOOST_MSVC) && !defined(BOOST_RE_BUILD_DLL)
#if defined(BOOST_MSVC) && !defined(BOOST_REGEX_BUILD_DLL)
#ifdef __SGI_STL_PORT
#ifdef _DLL
// All these are multithreaded:
@ -35,7 +35,7 @@
#pragma comment(lib, "vc6-stlport-re300ddl.lib")
#elif defined(_DEBUG)
#pragma comment(lib, "vc6-stlport-re300dl.lib")
#elif defined(BOOST_RE_STATIC_LIB)
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc6-stlport-re300ls.lib")
#else // DEBUG
@ -55,12 +55,12 @@
#error STLPort does not support single threaded builds
#endif //_MT
#endif //_DLL
#else
#elif _MSC_VER < 1300
#ifdef _DLL
// All these are multithreaded:
#ifdef _DEBUG
#pragma comment(lib, "vc6-re300dl.lib")
#elif defined(BOOST_RE_STATIC_LIB)
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc6-re300ls.lib")
#else // DEBUG
@ -81,15 +81,41 @@
#endif //_DEBUG
#endif //_MT
#endif //_DLL
#else
#ifdef _DLL
// All these are multithreaded:
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300dl.lib")
#elif defined(BOOST_REGEX_STATIC_LINK)
// static regex lib, dll runtime
#pragma comment(lib, "vc7-re300ls.lib")
#else // DEBUG
#pragma comment(lib, "vc7-re300l.lib")
#endif // _DEBUG
#else // _DLL
#ifdef _MT
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300dm.lib")
#else //_DEBUG
#pragma comment(lib, "vc7-re300m.lib")
#endif //_DEBUG
#else //_MT
#ifdef _DEBUG
#pragma comment(lib, "vc7-re300d.lib")
#else //_DEBUG
#pragma comment(lib, "vc7-re300.lib")
#endif //_DEBUG
#endif //_MT
#endif //_DLL
#endif // __SGI_STL_PORT
#endif //BOOST_MSVC
#if defined(__BORLANDC__) && !defined(BOOST_RE_BUILD_DLL)
#if defined(__BORLANDC__) && !defined(BOOST_REGEX_BUILD_DLL)
#if __BORLANDC__ < 0x550
#ifdef BOOST_RE_USE_VCL
#ifdef BOOST_REGEX_USE_VCL
#ifdef _RTLDLL
#pragma comment(lib, "bcb4re300lv.lib")
@ -117,7 +143,7 @@
#else // C++ Builder 5:
#ifdef BOOST_RE_USE_VCL
#ifdef BOOST_REGEX_USE_VCL
#ifdef _RTLDLL
#pragma comment(lib, "bcb5re300lv.lib")
@ -147,7 +173,7 @@
#endif //__BORLANDC__
#endif //BOOST_RE_NO_LIB
#endif //BOOST_REGEX_NO_LIB
#endif // BOOST_REGEX_LIBRARY_INCLUDE_HPP

View File

@ -31,15 +31,19 @@ namespace boost{
namespace re_detail{
#ifdef __BORLANDC__
#pragma option push -a4 -b -Ve -pc
#pragma option push -a4 -b -Ve -pc -w-8026
#endif
template <class iterator, class charT, class traits_type, class Allocator>
iterator BOOST_RE_CALL re_is_set_member(iterator next,
iterator BOOST_REGEX_CALL re_is_set_member(iterator next,
iterator last,
re_set_long* set_,
const reg_expression<charT, traits_type, Allocator>& e)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
const charT* p = (const charT*)(set_+1);
iterator ptr;
unsigned int i;
@ -140,14 +144,17 @@ iterator BOOST_RE_CALL re_is_set_member(iterator next,
if(traits_inst.is_class(col, set_->cclasses) == true)
return set_->isnot ? next : ++next;
return set_->isnot ? ++next : next;
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
}
template <class iterator, class Allocator>
class _priv_match_data
{
public:
typedef typename boost::re_detail::rebind_allocator<int, Allocator>::type i_alloc;
typedef typename boost::re_detail::rebind_allocator<iterator, Allocator>::type it_alloc;
typedef typename boost::detail::rebind_allocator<int, Allocator>::type i_alloc;
typedef typename boost::detail::rebind_allocator<iterator, Allocator>::type it_alloc;
match_results_base<iterator, Allocator> temp_match;
// failure stacks:
@ -208,7 +215,7 @@ void _priv_match_data<iterator, Allocator>::free()
i_alloc temp1(temp_match.allocator());
temp1.deallocate(accumulators, caccumulators);
for(unsigned i = 0; i < caccumulators; ++i)
jm_destroy(loop_starts + i);
::boost::re_detail::destroy(loop_starts + i);
it_alloc temp2(temp_match.allocator());
temp2.deallocate(loop_starts, caccumulators);
}
@ -242,7 +249,7 @@ struct access_t : public reg_expression<charT, traits, Allocator>
};
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
//
// Ugly ugly hack,
// template don't merge if they contain switch statements so declare these
@ -260,6 +267,10 @@ bool query_match_aux(iterator first,
_priv_match_data<iterator, Allocator>& pd,
iterator* restart)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
typedef access_t<charT, traits, Allocator2> access;
if(e.flags() & regbase::failbit)
@ -944,8 +955,11 @@ bool query_match_aux(iterator first,
// if we get to here then everything has failed
// and no match was found:
return false;
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
}
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
} // namespace
#endif
@ -1019,7 +1033,7 @@ struct grep_search_predicate
}
};
#if !defined(BOOST_RE_NO_TEMPLATE_RETURNS) && !defined(BOOST_RE_NO_PARTIAL_FUNC_SPEC)
#if !defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && !defined(BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING)
template <class iterator, class Allocator>
inline const match_results_base<iterator, Allocator>& grep_out_type(const grep_search_predicate<iterator, Allocator>& o, const Allocator&)
@ -1035,7 +1049,7 @@ inline const Allocator& grep_out_type(const T&, const Allocator& a)
return a;
}
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
//
// Ugly ugly hack,
// template don't merge if they contain switch statements so declare these
@ -1051,6 +1065,10 @@ namespace{
template <class Predicate, class I, class charT, class traits, class A, class A2>
unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<charT, traits, A>& e, unsigned flags, A2 a)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
typedef access_t<charT, traits, A> access;
if(e.flags() & regbase::failbit)
@ -1527,8 +1545,11 @@ unsigned int reg_grep2(Predicate foo, I first, I last, const reg_expression<char
}
return cmatches;
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
}
#if defined(BOOST_RE_NO_TEMPLATE_SWITCH_MERGE) && !defined(BOOST_RE_NO_NAMESPACES)
#if defined(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE)
} // namespace {anon}
#endif
@ -1565,7 +1586,7 @@ bool regex_match(iterator first, iterator last, const reg_expression<charT, trai
}
//
// query_match convenience interfaces:
#ifndef BOOST_RE_NO_PARTIAL_FUNC_SPEC
#ifndef BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
//
// this isn't really a partial specialisation, but template function
// overloading - if the compiler doesn't support partial specialisation
@ -1620,7 +1641,7 @@ inline bool regex_match(const char* str,
match_results<const char*> m;
return regex_match(str, str + regex::traits_type::length(str), m, e, flags);
}
#ifndef BOOST_RE_NO_WCSTRING
#ifndef BOOST_NO_WREGEX
inline bool regex_match(const wchar_t* str,
wcmatch& m,
const wregex& e,
@ -1650,7 +1671,7 @@ inline bool regex_match(const std::string& s,
match_results<std::string::const_iterator, regex::allocator_type> m;
return regex_match(s.begin(), s.end(), m, e, flags);
}
#if !defined(BOOST_RE_NO_WCSTRING)
#if !defined(BOOST_NO_WREGEX)
inline bool regex_match(const std::basic_string<wchar_t>& s,
match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
const wregex& e,
@ -1672,6 +1693,10 @@ inline bool regex_match(const std::basic_string<wchar_t>& s,
template <class iterator, class Allocator, class charT, class traits, class Allocator2>
bool regex_search(iterator first, iterator last, match_results<iterator, Allocator>& m, const reg_expression<charT, traits, Allocator2>& e, unsigned flags = match_default)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
if(e.flags() & regbase::failbit)
return false;
@ -1679,11 +1704,14 @@ bool regex_search(iterator first, iterator last, match_results<iterator, Allocat
typedef typename traits::uchar_type traits_uchar_type;
return re_detail::reg_grep2(re_detail::grep_search_predicate<iterator, Allocator>(&m), first, last, e, flags, m.allocator());
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
}
//
// regex_search convenience interfaces:
#ifndef BOOST_RE_NO_PARTIAL_FUNC_SPEC
#ifndef BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
//
// this isn't really a partial specialisation, but template function
// overloading - if the compiler doesn't support partial specialisation
@ -1713,7 +1741,7 @@ inline bool regex_search(const char* str,
{
return regex_search(str, str + regex::traits_type::length(str), m, e, flags);
}
#ifndef BOOST_RE_NO_WCSTRING
#ifndef BOOST_NO_WREGEX
inline bool regex_search(const wchar_t* str,
wcmatch& m,
const wregex& e,
@ -1729,7 +1757,7 @@ inline bool regex_search(const std::string& s,
{
return regex_search(s.begin(), s.end(), m, e, flags);
}
#if !defined(BOOST_RE_NO_WCSTRING)
#if !defined(BOOST_NO_WREGEX)
inline bool regex_search(const std::basic_string<wchar_t>& s,
match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>& m,
const wregex& e,
@ -1754,7 +1782,7 @@ inline unsigned int regex_grep(Predicate foo, iterator first, iterator last, con
//
// regex_grep convenience interfaces:
#ifndef BOOST_RE_NO_PARTIAL_FUNC_SPEC
#ifndef BOOST_WEAK_FUNCTION_TEMPLATE_ORDERING
//
// this isn't really a partial specialisation, but template function
// overloading - if the compiler doesn't support partial specialisation
@ -1781,7 +1809,7 @@ inline unsigned int regex_grep(bool (*foo)(const cmatch&), const char* str,
{
return regex_grep(foo, str, str + regex::traits_type::length(str), e, flags);
}
#ifndef BOOST_RE_NO_WCSTRING
#ifndef BOOST_NO_WREGEX
inline unsigned int regex_grep(bool (*foo)(const wcmatch&), const wchar_t* str,
const wregex& e,
unsigned flags = match_default)
@ -1795,7 +1823,7 @@ inline unsigned int regex_grep(bool (*foo)(const match_results<std::string::cons
{
return regex_grep(foo, s.begin(), s.end(), e, flags);
}
#if !defined(BOOST_RE_NO_WCSTRING)
#if !defined(BOOST_NO_WREGEX)
inline unsigned int regex_grep(bool (*foo)(const match_results<std::basic_string<wchar_t>::const_iterator, wregex::allocator_type>&),
const std::basic_string<wchar_t>& s,
const wregex& e,

View File

@ -1,146 +0,0 @@
#ifndef BOOST_RE_OPT_H
#define BOOST_RE_OPT_H
/* #define BOOST_RE_AUTO_CONFIGURE */
#ifdef BOOST_RE_AUTO_CONFIGURE
/* Compiler options: */
/* BOOST_NO_STDC_NAMESPACE C library not in namespace std */
/* #define BOOST_NO_STDC_NAMESPACE */
/* BOOST_RE_PLATFORM_W32 Platform is MS Win32 */
/* #define BOOST_RE_PLATFORM_W32 */
/* BOOST_RE_NO_W32 Disable Win32 support even when present */
/* #define BOOST_RE_NO_W32 */
/* BOOST_RE_NO_BOOL If bool is not a distict type. */
/* #define BOOST_RE_NO_BOOL */
/* BOOST_RE_NO_WCHAR_H If there is no <wchar.h> */
/* #define BOOST_RE_NO_WCHAR_H */
/* BOOST_RE_NO_WCTYPE_H If there is no <wctype.h> */
/* #define BOOST_RE_NO_WCTYPE_H */
/* BOOST_RE_NO_WCSTRING If there are no wcslen and wcsncmp functions available. */
/* #define BOOST_RE_NO_WCSTRING */
/* BOOST_RE_NO_SWPRINTF If there is no swprintf available. */
/* #define BOOST_RE_NO_SWPRINTF */
/* BOOST_RE_NO_WSPRINTF If there is no wsprintf available. */
/* #define BOOST_RE_NO_WSPRINTF */
/* BOOST_NO_MEMBER_TEMPLATES If member function templates or nested template classes are not allowed. */
/* #define BOOST_NO_MEMBER_TEMPLATES */
/* BOOST_RE_NO_TEMPLATE_RETURNS If template functions based on return type are not supported. */
/* #define BOOST_RE_NO_TEMPLATE_RETURNS */
/* BOOST_RE_NO_PARTIAL_FUNC_SPEC If partial template function specialisation is not supported */
/* #define BOOST_RE_NO_PARTIAL_FUNC_SPEC */
/* BOOST_RE_NO_CAT Define if the compiler does not support POSIX style
message categories (catopen catgets catclose). */
/* #define BOOST_RE_NO_CAT */
/* BOOST_RE_THREADS Define if the compiler supports multiple threads in
the current translation mode. */
/* #define BOOST_RE_THREADS */
/* BOOST_RE_NO_TEMPLATE_MERGE If template in separate translation units don't merge at link time */
/* #define BOOST_RE_NO_TEMPLATE_MERGE */
/* BOOST_RE_NO_TEMPLATE_MERGE_A If template merging from library archives is not supported */
/* #define BOOST_RE_NO_TEMPLATE_MERGE_A */
/* BOOST_RE_NO_TEMPLATE_SWITCH_MERGE If merging of templates containing switch statements is not supported */
/* #define BOOST_RE_NO_TEMPLATE_SWITCH_MERGE */
/* BOOST_RE_CALL Optionally define a calling convention for C++ functions */
/* #define BOOST_RE_CALL */
/* BOOST_RE_CCALL Optionally define a calling convention for C functions */
/* #define BOOST_RE_CCALL */
/* BOOST_RE_SIZEOF_SHORT sizeof(short) */
/* #define BOOST_RE_SIZEOF_SHORT */
/* BOOST_RE_SIZEOF_INT sizeof(int) */
/* #define BOOST_RE_SIZEOF_INT */
/* BOOST_RE_SIZEOF_LONG sizeof(long) */
/* #define BOOST_RE_SIZEOF_LONG */
/* BOOST_RE_SIZEOF_WCHAR_T sizeof(wchar_t) */
/* #define BOOST_RE_SIZEOF_WCHAR_T */
/* STL options: */
/* BOOST_RE_NO_ITERATOR_H Define if you do not have a version of <iterator>. */
/* #define BOOST_RE_NO_ITERATOR_H */
/* BOOST_NO_STD_ALLOCATOR Define if <memory> does not fully comply with the
latest standard, and is not auto-recognised,
that means nested template classes
which hardly any compilers support at present. */
/* #define BOOST_NO_STD_ALLOCATOR */
/* BOOST_RE_NO_LOCALE_H Define if there is no verion of the standard
<locale> header available. */
/* #define BOOST_RE_NO_LOCALE_H */
/* BOOST_RE_NO_STL Disables the use of any supporting STL code. */
/* #define BOOST_RE_NO_STL */
/* BOOST_RE_NO_NOT_EQUAL Disables the generation of operator!= if this
clashes with the STL version. */
/* BOOST_RE_NO_STRING_DEF_ARGS Define if std::basic_string<charT> not allowed - in
other words if the template is missing its required
default arguments. */
/* #define BOOST_RE_NO_STRING_DEF_ARGS */
/* BOOST_RE_USE_ALGO If <algo.h> not <algorithm> is present */
/* #define BOOST_RE_USE_ALGO */
/* BOOST_RE_OLD_IOSTREAM If the new iostreamm classes are not available */
/* #define BOOST_RE_OLD_IOSTREAM */
/* BOOST_NO_STD_DISTANCE If there is no std::distance. */
/* #define BOOST_NO_STD_DISTANCE */
/* BOOST_RE_NO_OI_ASSIGN If output iterators ostream_iterator<>, back_insert_iterator<> and
front_insert_iterator<> do not have assignment operators */
/* #define BOOST_RE_NO_OI_ASSIGN */
#include <stdexcept>
#ifndef BOOST_RE_NO_ITERATOR_H
#include <iterator>
#ifdef BOOST_RE_USE_ALGO
#include <algo.h>
#else
#include <algorithm>
#endif
#endif
#endif // BOOST_RE_AUTO_CONFIGURE
#endif /* BOOST_RE_OPT_H */

View File

@ -26,7 +26,7 @@
#define BOOST_REGEX_RAW_BUFFER_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#endif
namespace boost{
@ -105,7 +105,7 @@ class raw_storage
{
public:
typedef Allocator allocator_type;
typedef typename boost::re_detail::rebind_allocator<unsigned char, allocator_type>::type alloc_inst_type;
typedef typename boost::detail::rebind_allocator<unsigned char, allocator_type>::type alloc_inst_type;
typedef typename alloc_inst_type::size_type size_type;
typedef typename alloc_inst_type::pointer pointer;
private:
@ -127,9 +127,9 @@ public:
alloc_inst.deallocate(start, (alloc_inst.last - start));
}
void BOOST_RE_CALL resize(size_type n);
void BOOST_REGEX_CALL resize(size_type n);
void* BOOST_RE_CALL extend(size_type n)
void* BOOST_REGEX_CALL extend(size_type n)
{
if(size_type(alloc_inst.last - end) < n)
resize(n + (end - start));
@ -138,44 +138,44 @@ public:
return result;
}
void* BOOST_RE_CALL insert(size_type pos, size_type n);
void* BOOST_REGEX_CALL insert(size_type pos, size_type n);
size_type BOOST_RE_CALL size()
size_type BOOST_REGEX_CALL size()
{
return end - start;
}
size_type BOOST_RE_CALL capacity()
size_type BOOST_REGEX_CALL capacity()
{
return alloc_inst.last - start;
}
void* BOOST_RE_CALL data()const
void* BOOST_REGEX_CALL data()const
{
return start;
}
size_type BOOST_RE_CALL index(void* ptr)
size_type BOOST_REGEX_CALL index(void* ptr)
{
return (unsigned char*)ptr - (unsigned char*)data();
}
void BOOST_RE_CALL clear()
void BOOST_REGEX_CALL clear()
{
end = start;
}
void BOOST_RE_CALL align()
void BOOST_REGEX_CALL align()
{
// move end up to a boundary:
end = (unsigned char*)start + ((((unsigned char*)end - (unsigned char*)start) + padding_mask) & ~padding_mask);
}
Allocator BOOST_RE_CALL allocator()const;
Allocator BOOST_REGEX_CALL allocator()const;
};
template <class Allocator>
CONSTRUCTOR_INLINE raw_storage<Allocator>::raw_storage(const Allocator& a)
raw_storage<Allocator>::raw_storage(const Allocator& a)
: alloc_inst(a)
{
start = end = alloc_inst.allocate(1024);
@ -183,7 +183,7 @@ CONSTRUCTOR_INLINE raw_storage<Allocator>::raw_storage(const Allocator& a)
}
template <class Allocator>
CONSTRUCTOR_INLINE raw_storage<Allocator>::raw_storage(size_type n, const Allocator& a)
raw_storage<Allocator>::raw_storage(size_type n, const Allocator& a)
: alloc_inst(a)
{
start = end = alloc_inst.allocate(n);
@ -191,13 +191,13 @@ CONSTRUCTOR_INLINE raw_storage<Allocator>::raw_storage(size_type n, const Alloca
}
template <class Allocator>
Allocator BOOST_RE_CALL raw_storage<Allocator>::allocator()const
Allocator BOOST_REGEX_CALL raw_storage<Allocator>::allocator()const
{
return alloc_inst;
}
template <class Allocator>
void BOOST_RE_CALL raw_storage<Allocator>::resize(size_type n)
void BOOST_REGEX_CALL raw_storage<Allocator>::resize(size_type n)
{
register size_type newsize = (alloc_inst.last - start) * 2;
register size_type datasize = end - start;
@ -220,7 +220,7 @@ void BOOST_RE_CALL raw_storage<Allocator>::resize(size_type n)
}
template <class Allocator>
void* BOOST_RE_CALL raw_storage<Allocator>::insert(size_type pos, size_type n)
void* BOOST_REGEX_CALL raw_storage<Allocator>::insert(size_type pos, size_type n)
{
jm_assert(pos <= size_type(end - start));
if(size_type(alloc_inst.last - end) < n)

View File

@ -61,6 +61,10 @@ template <class OutputIterator, class charT, class Traits1, class Alloc1, class
bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
(const match_results<iterator_type, Alloc2>& what)
{
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4800)
#endif
*p_last = what[0].second;
if(what.size() > 1)
{
@ -86,6 +90,9 @@ bool split_pred<OutputIterator, charT, Traits1, Alloc1, Alloc2>::operator()
//
// initial null, do nothing:
return true;
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
}
} // namespace re_detail

View File

@ -26,7 +26,7 @@
#define BOOST_REGEX_STACK_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#endif
#ifndef BOOST_REGEX_RAW_BUFFER_HPP
#include <boost/regex/detail/regex_raw_buffer.hpp>
@ -44,12 +44,12 @@ namespace boost{
// simplified stack optimised for push/peek/pop
// operations, we could use std::stack<std::vector<T>> instead...
//
template <class T, class Allocator BOOST_RE_DEF_ALLOC_PARAM(T) >
template <class T, class Allocator = BOOST_DEFAULT_ALLOCATOR(T) >
class jstack
{
private:
typedef typename boost::re_detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
typedef typename boost::re_detail::rebind_allocator<T, Allocator>::type T_alloc_type;
typedef typename boost::detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
typedef typename boost::detail::rebind_allocator<T, Allocator>::type T_alloc_type;
typedef typename T_alloc_type::size_type size_type;
typedef T value_type;
struct node
@ -74,15 +74,15 @@ private:
node base;
size_type block_size;
void BOOST_RE_CALL pop_aux()const;
void BOOST_RE_CALL push_aux();
void BOOST_REGEX_CALL pop_aux()const;
void BOOST_REGEX_CALL push_aux();
public:
jstack(size_type n = 64, const Allocator& a = Allocator());
~jstack();
node* BOOST_RE_CALL get_node()
node* BOOST_REGEX_CALL get_node()
{
node* new_stack = (node*)alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size);
new_stack->last = (T*)(new_stack+1);
@ -91,53 +91,53 @@ public:
return new_stack;
}
bool BOOST_RE_CALL empty()
bool BOOST_REGEX_CALL empty()
{
return (m_stack->start == m_stack->end) && (m_stack->next == 0);
}
bool BOOST_RE_CALL good()
bool BOOST_REGEX_CALL good()
{
return (m_stack->start != m_stack->end) || (m_stack->next != 0);
}
T& BOOST_RE_CALL peek()
T& BOOST_REGEX_CALL peek()
{
if(m_stack->start == m_stack->end)
pop_aux();
return *m_stack->end;
}
const T& BOOST_RE_CALL peek()const
const T& BOOST_REGEX_CALL peek()const
{
if(m_stack->start == m_stack->end)
pop_aux();
return *m_stack->end;
}
void BOOST_RE_CALL pop()
void BOOST_REGEX_CALL pop()
{
if(m_stack->start == m_stack->end)
pop_aux();
jm_destroy(m_stack->end);
::boost::re_detail::destroy(m_stack->end);
++(m_stack->end);
}
void BOOST_RE_CALL pop(T& t)
void BOOST_REGEX_CALL pop(T& t)
{
if(m_stack->start == m_stack->end)
pop_aux();
t = *m_stack->end;
jm_destroy(m_stack->end);
::boost::re_detail::destroy(m_stack->end);
++(m_stack->end);
}
void BOOST_RE_CALL push(const T& t)
void BOOST_REGEX_CALL push(const T& t)
{
if(m_stack->end == m_stack->last)
push_aux();
--(m_stack->end);
jm_construct(m_stack->end, t);
construct(m_stack->end, t);
}
};
@ -155,7 +155,7 @@ jstack<T, Allocator>::jstack(size_type n, const Allocator& a)
}
template <class T, class Allocator>
void BOOST_RE_CALL jstack<T, Allocator>::push_aux()
void BOOST_REGEX_CALL jstack<T, Allocator>::push_aux()
{
// make sure we have spare space on TOS:
register node* new_node;
@ -175,7 +175,7 @@ void BOOST_RE_CALL jstack<T, Allocator>::push_aux()
}
template <class T, class Allocator>
void BOOST_RE_CALL jstack<T, Allocator>::pop_aux()const
void BOOST_REGEX_CALL jstack<T, Allocator>::pop_aux()const
{
// make sure that we have a valid item
// on TOS:

View File

@ -26,20 +26,20 @@
#define BOOST_REGEX_SYNCH_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/detail/regex_config.hpp>
#include <boost/regex/config.hpp>
#endif
#if defined(BOOST_RE_PLATFORM_W32) && defined(BOOST_RE_THREADS)
#include <windows.h>
#endif
#if !defined(BOOST_RE_PLATFORM_W32) && defined(BOOST_RE_THREADS)
#if defined(__BEOS__)
#include <OS.h>
#include <cassert>
#else
#include <pthread.h>
#endif
#if defined(BOOST_HAS_THREADS)
# if defined(BOOST_HAS_WINTHREADS)
# include <windows.h>
# elif defined(BOOST_HAS_BETHREADS)
# include <OS.h>
# include <cassert>
# elif defined(BOOST_HAS_PTHREADS)
# include <pthread.h>
# else
# error "Unknown threading API"
# endif
#endif
@ -50,65 +50,66 @@ namespace boost{
#pragma option push -a4 -b -Ve -pc
#endif
void BOOST_RE_CALL re_init_threads();
void BOOST_RE_CALL re_free_threads();
void BOOST_REGEX_CALL re_init_threads();
void BOOST_REGEX_CALL re_free_threads();
#ifdef BOOST_RE_THREADS
#ifdef BOOST_HAS_THREADS
#ifndef BOOST_RE_PLATFORM_W32
#ifdef __BEOS__
# ifdef BOOST_HAS_BETHREADS
typedef sem_id CRITICAL_SECTION;
inline void BOOST_RE_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
{
*ps = create_sem(1, "regex++");
assert(*ps > 0);
}
inline void BOOST_RE_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
{
int t = delete_sem(*ps);
assert(t == B_NO_ERROR);
}
inline void BOOST_RE_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
{
status_t t = acquire_sem(*ps);
assert(t == B_NO_ERROR);
}
inline void BOOST_RE_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
{
status_t t = release_sem(*ps);
assert(t == B_NO_ERROR);
}
#else // __BEOS__
# elif defined(BOOST_HAS_PTHREADS)
typedef pthread_mutex_t CRITICAL_SECTION;
inline void BOOST_RE_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL InitializeCriticalSection(CRITICAL_SECTION* ps)
{
pthread_mutex_init(ps, 0);
}
inline void BOOST_RE_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL DeleteCriticalSection(CRITICAL_SECTION* ps)
{
pthread_mutex_destroy(ps);
}
inline void BOOST_RE_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL EnterCriticalSection(CRITICAL_SECTION* ps)
{
pthread_mutex_lock(ps);
}
inline void BOOST_RE_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
inline void BOOST_REGEX_CALL LeaveCriticalSection(CRITICAL_SECTION* ps)
{
pthread_mutex_unlock(ps);
}
#endif // __BEOS__
#endif
# elif !defined(BOOST_HAS_WINTHREADS)
# error "Unknown threading API"
# endif
template <class Lock>
class lock_guard
@ -121,7 +122,7 @@ public:
~lock_guard()
{ acquire(false); }
void BOOST_RE_CALL acquire(bool aq = true)
void BOOST_REGEX_CALL acquire(bool aq = true)
{
if(aq && !owned)
{
@ -151,7 +152,7 @@ public:
critical_section(const critical_section&)
{ InitializeCriticalSection(&hmutex);}
const critical_section& BOOST_RE_CALL operator=(const critical_section&)
const critical_section& BOOST_REGEX_CALL operator=(const critical_section&)
{return *this;}
~critical_section()
@ -159,7 +160,7 @@ public:
private:
void BOOST_RE_CALL acquire(bool aq)
void BOOST_REGEX_CALL acquire(bool aq)
{ if(aq) EnterCriticalSection(&hmutex);
else LeaveCriticalSection(&hmutex);
}
@ -173,20 +174,20 @@ public:
friend class lock_guard<critical_section>;
};
inline bool BOOST_RE_CALL operator==(const critical_section&, const critical_section&)
inline bool BOOST_REGEX_CALL operator==(const critical_section&, const critical_section&)
{
return false;
}
inline bool BOOST_RE_CALL operator<(const critical_section&, const critical_section&)
inline bool BOOST_REGEX_CALL operator<(const critical_section&, const critical_section&)
{
return true;
}
typedef lock_guard<critical_section> cs_guard;
BOOST_RE_IX_DECL extern critical_section* p_re_lock;
BOOST_RE_IX_DECL extern unsigned int re_lock_count;
BOOST_REGEX_DECL extern critical_section* p_re_lock;
BOOST_REGEX_DECL extern unsigned int re_lock_count;
#define BOOST_RE_GUARD(inst) boost::re_detail::critical_section::rw_guard g(inst);