Compare commits

...

41 Commits

Author SHA1 Message Date
bba09dc13b bcbboost branch rebased on current release
[SVN r49389]
2008-10-19 14:43:01 +00:00
5e951c6620 Merge from trunk
[SVN r49099]
2008-10-01 22:38:45 +00:00
35212a4063 Patches for Codegear C++ Builder 2009
[SVN r48981]
2008-09-27 08:59:20 +00:00
d70f98e658 Fixes #2306.
Change "id" to "state_id".

[SVN r48751]
2008-09-12 12:40:23 +00:00
18623d00af Fix Jamfile logic: BOOST_REGEX_ICU_OPTS needs to be a list not a string.
[SVN r48574]
2008-09-04 08:36:34 +00:00
30074a601a Add /usr/local/include to the list of include paths for ICU on FreeBSD.
[SVN r48454]
2008-08-29 17:11:18 +00:00
4212c0d915 Update TR1 library to cope with GCC-4.3 in C++0x mode, and in TR1 mode.
Updated regex concepts to match the TR1.
Added "tricky" cmath_test to test for the functions Boost doesn't implement.

[SVN r48413]
2008-08-28 11:02:59 +00:00
1297f92b8a Tentative fix for issue #2244: ICU uses wchar_t as UCHAR whenever sizeof(wchar_t) == 2.
[SVN r48312]
2008-08-23 11:40:58 +00:00
cb5443477b Fix for VC8 without the service pack.
[SVN r48220]
2008-08-19 15:54:39 +00:00
1012d28c32 Fix for issue #2188.
[SVN r48185]
2008-08-17 11:15:07 +00:00
3a15c301db Disable MSVC std lib workarounds if we're really using STLPort or Apache/RW std lib.
[SVN r47880]
2008-07-30 09:35:44 +00:00
546dd9f6fb Fixes #1940.
[SVN r47795]
2008-07-25 09:28:01 +00:00
be28ad44c7 Tentative fix for some VC failures.
[SVN r47542]
2008-07-18 11:29:50 +00:00
6eb35e2cf1 Fixes #2097.
[SVN r47319]
2008-07-11 18:00:15 +00:00
831156d759 Replace a couple of non-ascii symbols.
[SVN r46943]
2008-07-01 09:58:27 +00:00
d7d38da27f Changed POSIX API functions to use the global C locale.
Fixes #1446.

[SVN r46170]
2008-06-05 17:07:42 +00:00
31b68369ae Patch for VC9 explicit template instantiation.
Fixes #1959.

[SVN r46077]
2008-06-03 12:52:55 +00:00
4c105a90a1 Changed behaviour of \B so that it succeeds when the neither adjacent character is a word character.
[SVN r45354]
2008-05-14 11:19:58 +00:00
8928c7737e Added needed #includes to source files.
[SVN r45353]
2008-05-14 11:14:30 +00:00
3704b9c595 Fixes for issue #1871 that prevents duplicate symbol errors with VC++ compilers, when building with /Zc:wchar_t-.
[SVN r44842]
2008-04-28 11:07:14 +00:00
5fdf2752ae Add explicit type cast to fix GCC-C++0X mode error.
[SVN r44437]
2008-04-15 17:50:11 +00:00
c7dda1b549 Fix doc typo from issue #1794.
[SVN r44169]
2008-04-11 08:53:54 +00:00
6e9b9a7995 Doh! Changes to code should actually compile!
A fix for the last change.

[SVN r44145]
2008-04-10 12:46:41 +00:00
e5bc36d7c9 Fix for bug #1790.
[SVN r44128]
2008-04-09 15:32:08 +00:00
c9d1a42e05 Added missing files.
[SVN r43632]
2008-03-15 18:19:11 +00:00
e32c5d0888 Added link to PDF docs, and regenerated.
[SVN r43351]
2008-02-21 12:58:15 +00:00
370c429bd6 Added comment to suppress inspect warning.
[SVN r43148]
2008-02-07 10:24:29 +00:00
0915f19c03 Extended leading repeat optimization to more cases.
[SVN r42992]
2008-01-27 18:43:35 +00:00
37040f4bfd Applies fix for issue #1598: added missing #include.
[SVN r42929]
2008-01-23 16:08:44 +00:00
2cbd1c8882 Patch regex concept checks and TR1 library to work with VC9 + MS TR1 feature pack.
[SVN r42751]
2008-01-14 13:17:09 +00:00
37cd93fc82 Fix documentation typos.
[SVN r42747]
2008-01-14 09:58:36 +00:00
b1af72fd23 Ooops, fix broken escape sequence.
[SVN r42745]
2008-01-14 09:46:12 +00:00
299086b99c Fix bugs reported by Will Drewry: certain invalid regexes can cause the library to access invalid memory, changed to ensure that the correct exception is thrown long before this happens.
[SVN r42674]
2008-01-11 09:55:43 +00:00
07eaac9e0e Fix typos.
[SVN r42455]
2008-01-04 16:54:35 +00:00
71fdd5eb44 Fix typos reported by Sebastian Pipping.
[SVN r42025]
2007-12-14 10:11:21 +00:00
31668ed4be Fixes #1471.
[SVN r41973]
2007-12-11 17:28:15 +00:00
f72c7518be Fixes #1455.
[SVN r41970]
2007-12-11 17:19:03 +00:00
2995393609 Oops, previous commit messed up POSIX timing code, now fixed.
[SVN r41359]
2007-11-25 15:47:58 +00:00
872b69bbc4 Merge from trunk
[SVN r39768]
2007-10-07 20:10:53 +00:00
55588f72f9 Merge from trunk
[SVN r39533]
2007-09-25 22:53:44 +00:00
4a16d482fc Branch for CodeGear (Borland) specific fixes
[SVN r39356]
2007-09-17 20:28:43 +00:00
3 changed files with 456 additions and 0 deletions

View File

@ -0,0 +1,123 @@
/*
*
* Copyright (c) 1998-2002
* 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 regex_cstring.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: This is an internal header file, do not include directly.
* String support and helper functions, for regular
* expression library.
*/
#ifndef BOOST_REGEX_CSTRING_HPP
#define BOOST_REGEX_CSTRING_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/config.hpp>
#endif
#include <cstring>
namespace boost{
namespace re_detail{
//
// start by defining some template function aliases for C API functions:
//
template <class charT>
std::size_t BOOST_REGEX_CALL re_strlen(const charT *s)
{
std::size_t len = 0;
while(*s)
{
++s;
++len;
}
return len;
}
inline std::size_t BOOST_REGEX_CALL re_strlen(const char *s)
{
return std::strlen(s);
}
#ifndef BOOST_NO_WREGEX
inline std::size_t BOOST_REGEX_CALL re_strlen(const wchar_t *s)
{
return std::wcslen(s);
}
#endif
#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_REGEX_DECL void BOOST_REGEX_CALL re_transform(std::string& out, const std::string& in);
template <class charT>
void BOOST_REGEX_CALL re_trunc_primary(std::basic_string<charT>& s)
{
for(unsigned int i = 0; i < s.size(); ++i)
{
if(s[i] <= 1)
{
s.erase(i);
break;
}
}
}
inline char* BOOST_REGEX_CALL re_strcpy(char *s1, const char *s2)
{
#if defined(__BORLANDC__) && defined(strcpy)
return ::strcpy(s1, s2);
#else
return std::strcpy(s1, s2);
#endif
}
#ifndef BOOST_NO_WREGEX
inline wchar_t* BOOST_REGEX_CALL re_strcpy(wchar_t *s1, const wchar_t *s2)
{
return std::wcscpy(s1, s2);
}
#endif
template <class charT>
charT* BOOST_REGEX_CALL re_strdup(const charT* p)
{
charT* buf = new charT[re_strlen(p) + 1];
re_strcpy(buf, p);
return buf;
}
template <class charT>
inline void BOOST_REGEX_CALL re_strfree(charT* p)
{
delete[] p;
}
} // namespace re_detail
} // namespace boost
#endif // BOOST_REGEX_CSTRING_HPP

View File

@ -0,0 +1,108 @@
/*
*
* Copyright (c) 1998-2002
* 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 regex_kmp.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Provides Knuth Morris Pratt search operations.
* Note this is an internal header file included
* by regex.hpp, do not include on its own.
*/
#ifndef BOOST_REGEX_KMP_HPP
#define BOOST_REGEX_KMP_HPP
#ifdef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/config.hpp>
#endif
namespace boost{
namespace re_detail{
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
template <class charT>
struct kmp_info
{
unsigned int size;
unsigned int len;
const charT* pstr;
int kmp_next[1];
};
template <class charT, class Allocator>
void kmp_free(kmp_info<charT>* pinfo, const Allocator& a)
{
typedef typename boost::detail::rebind_allocator<char, Allocator>::type atype;
atype(a).deallocate(reinterpret_cast<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::detail::rebind_allocator<char, Allocator>::type atype;
int i, j, m;
i = 0;
m = static_cast<int>(::boost::re_detail::distance(first, last));
++m;
unsigned int size = sizeof(kmp_info<charT>) + sizeof(int)*m + sizeof(charT)*m;
--m;
//
// allocate struct and fill it in:
//
kmp_info<charT>* pinfo = reinterpret_cast<kmp_info<charT>*>(atype(a).allocate(size));
BOOST_REGEX_NOEH_ASSERT(pinfo)
pinfo->size = size;
pinfo->len = m;
charT* p = reinterpret_cast<charT*>(reinterpret_cast<char*>(pinfo) + sizeof(kmp_info<charT>) + sizeof(int)*(m+1));
pinfo->pstr = p;
while(first != last)
{
*p = translate(*first);
++first;
++p;
}
*p = 0;
//
// finally do regular kmp compile:
//
j = pinfo->kmp_next[0] = -1;
while (i < m)
{
while ((j > -1) && (pinfo->pstr[i] != pinfo->pstr[j]))
j = pinfo->kmp_next[j];
++i;
++j;
if (pinfo->pstr[i] == pinfo->pstr[j])
pinfo->kmp_next[i] = pinfo->kmp_next[j];
else
pinfo->kmp_next[i] = j;
}
return pinfo;
}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
} // namepsace re_detail
} // namespace boost
#endif // BOOST_REGEX_KMP_HPP

View File

@ -0,0 +1,225 @@
/*
*
* Copyright (c) 1998-2002
* 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 regex_stack.hpp
* VERSION see <boost/version.hpp>
* DESCRIPTION: Implements customised internal regex stacks.
* Note this is an internal header file included
* by regex.hpp, do not include on its own.
*/
#ifndef BOOST_REGEX_STACK_HPP
#define BOOST_REGEX_STACK_HPP
#ifndef BOOST_REGEX_CONFIG_HPP
#include <boost/regex/config.hpp>
#endif
#ifndef BOOST_REGEX_RAW_BUFFER_HPP
#include <boost/regex/v4/regex_raw_buffer.hpp>
#endif
namespace boost{
namespace re_detail{
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_PREFIX
#endif
//
// class jstack
// simplified stack optimised for push/peek/pop
// operations, we could use std::stack<std::vector<T>> instead...
//
template <class T, class Allocator = BOOST_DEFAULT_ALLOCATOR(T) >
class jstack
{
public:
typedef typename boost::detail::rebind_allocator<unsigned char, Allocator>::type allocator_type;
private:
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
{
node* next;
T* start; // first item
T* end; // last item
T* last; // end of storage
};
//
// empty base member optimisation:
struct data : public allocator_type
{
padding buf[(sizeof(T) * 16 + sizeof(padding) - 1) / sizeof(padding)];
data(const Allocator& a) : allocator_type(a){}
};
data alloc_inst;
mutable node* m_stack;
mutable node* unused;
node base;
size_type block_size;
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_REGEX_CALL get_node()
{
node* new_stack = reinterpret_cast<node*>(alloc_inst.allocate(sizeof(node) + sizeof(T) * block_size));
BOOST_REGEX_NOEH_ASSERT(new_stack)
new_stack->last = reinterpret_cast<T*>(new_stack+1);
new_stack->start = new_stack->end = new_stack->last + block_size;
new_stack->next = 0;
return new_stack;
}
bool BOOST_REGEX_CALL empty()
{
return (m_stack->start == m_stack->end) && (m_stack->next == 0);
}
bool BOOST_REGEX_CALL good()
{
return (m_stack->start != m_stack->end) || (m_stack->next != 0);
}
T& BOOST_REGEX_CALL peek()
{
if(m_stack->start == m_stack->end)
pop_aux();
return *m_stack->end;
}
const T& BOOST_REGEX_CALL peek()const
{
if(m_stack->start == m_stack->end)
pop_aux();
return *m_stack->end;
}
void BOOST_REGEX_CALL pop()
{
if(m_stack->start == m_stack->end)
pop_aux();
::boost::re_detail::pointer_destroy(m_stack->end);
++(m_stack->end);
}
void BOOST_REGEX_CALL pop(T& t)
{
if(m_stack->start == m_stack->end)
pop_aux();
t = *m_stack->end;
::boost::re_detail::pointer_destroy(m_stack->end);
++(m_stack->end);
}
void BOOST_REGEX_CALL push(const T& t)
{
if(m_stack->end == m_stack->last)
push_aux();
--(m_stack->end);
pointer_construct(m_stack->end, t);
}
};
template <class T, class Allocator>
jstack<T, Allocator>::jstack(size_type n, const Allocator& a)
: alloc_inst(a)
{
unused = 0;
block_size = n;
m_stack = &base;
base.last = reinterpret_cast<T*>(alloc_inst.buf);
base.end = base.start = base.last + 16;
base.next = 0;
}
template <class T, class Allocator>
void BOOST_REGEX_CALL jstack<T, Allocator>::push_aux()
{
// make sure we have spare space on TOS:
register node* new_node;
if(unused)
{
new_node = unused;
unused = new_node->next;
new_node->next = m_stack;
m_stack = new_node;
}
else
{
new_node = get_node();
new_node->next = m_stack;
m_stack = new_node;
}
}
template <class T, class Allocator>
void BOOST_REGEX_CALL jstack<T, Allocator>::pop_aux()const
{
// make sure that we have a valid item
// on TOS:
BOOST_ASSERT(m_stack->next);
register node* p = m_stack;
m_stack = p->next;
p->next = unused;
unused = p;
}
template <class T, class Allocator>
jstack<T, Allocator>::~jstack()
{
node* condemned;
while(good())
pop();
while(unused)
{
condemned = unused;
unused = unused->next;
alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
}
while(m_stack != &base)
{
condemned = m_stack;
m_stack = m_stack->next;
alloc_inst.deallocate(reinterpret_cast<unsigned char*>(condemned), sizeof(node) + sizeof(T) * block_size);
}
}
#ifdef BOOST_HAS_ABI_HEADERS
# include BOOST_ABI_SUFFIX
#endif
} // namespace re_detail
} // namespace boost
#endif