Change detail namespace.

Big search and replace to change name of internal namepace so it's mangled with the Boost version number - the aim is to reduce the chances of mixing different header and library versions.
This commit is contained in:
jzmaddock
2015-04-04 19:10:37 +01:00
parent 297e87360c
commit 6ffcc5ede0
55 changed files with 609 additions and 598 deletions

View File

@ -77,7 +77,7 @@ c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transfo
c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transform_primary(const char* p1, const char* p2)
{
static char s_delim;
static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast<c_regex_traits<char>*>(0), &s_delim);
static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast<c_regex_traits<char>*>(0), &s_delim);
std::string result;
//
// What we do here depends upon the format of the sort key returned by
@ -85,8 +85,8 @@ c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transfo
//
switch(s_collate_type)
{
case ::boost::re_detail::sort_C:
case ::boost::re_detail::sort_unknown:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_C:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown:
// the best we can do is translate to lower case, then get a regular sort key:
{
result.assign(p1, p2);
@ -95,14 +95,14 @@ c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::transfo
result = transform(&*result.begin(), &*result.begin() + result.size());
break;
}
case ::boost::re_detail::sort_fixed:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed:
{
// get a regular sort key, and then truncate it:
result = transform(p1, p2);
result.erase(s_delim);
break;
}
case ::boost::re_detail::sort_delim:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim:
// get a regular sort key, and then truncate everything after the delim:
result = transform(p1, p2);
if(result.size() && (result[0] == s_delim))
@ -149,13 +149,13 @@ c_regex_traits<char>::char_class_type BOOST_REGEX_CALL c_regex_traits<char>::loo
char_class_xdigit,
};
int idx = ::boost::re_detail::get_default_class_id(p1, p2);
int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx < 0)
{
std::string s(p1, p2);
for(std::string::size_type i = 0; i < s.size(); ++i)
s[i] = static_cast<char>((std::tolower)(static_cast<unsigned char>(s[i])));
idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(std::size_t(idx+1) < sizeof(masks) / sizeof(masks[0]));
return masks[idx+1];
@ -173,16 +173,16 @@ bool BOOST_REGEX_CALL c_regex_traits<char>::isctype(char c, char_class_type mask
|| ((mask & char_class_digit) && (std::isdigit)(static_cast<unsigned char>(c)))
|| ((mask & char_class_punct) && (std::ispunct)(static_cast<unsigned char>(c)))
|| ((mask & char_class_xdigit) && (std::isxdigit)(static_cast<unsigned char>(c)))
|| ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c))
|| ((mask & char_class_blank) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
|| ((mask & char_class_word) && (c == '_'))
|| ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == '\v')))
|| ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::re_detail::is_separator(c) && (c != '\v'));
|| ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == '\v')))
|| ((mask & char_class_horizontal) && (std::isspace)(static_cast<unsigned char>(c)) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != '\v'));
}
c_regex_traits<char>::string_type BOOST_REGEX_CALL c_regex_traits<char>::lookup_collatename(const char* p1, const char* p2)
{
std::string s(p1, p2);
s = ::boost::re_detail::lookup_default_collate_name(s);
s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s);
if(s.empty() && (p2-p1 == 1))
s.append(1, *p1);
return s;

View File

@ -28,7 +28,7 @@ namespace std{
}
#endif
namespace boost{ namespace re_detail{
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
void cpp_regex_traits_char_layer<char>::init()
{
@ -51,7 +51,7 @@ void cpp_regex_traits_char_layer<char>::init()
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
boost::re_detail::raise_runtime_error(err);
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
@ -111,7 +111,7 @@ void cpp_regex_traits_char_layer<char>::init()
}while(0xFF != i++);
}
} // re_detail
} // BOOST_REGEX_DETAIL_NS
} // boost
#endif

View File

@ -68,7 +68,7 @@ inline std::string to_string(const char* i, const char* j)
}
}
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
class RegExData
{
@ -141,12 +141,12 @@ void RegExData::clean()
RegEx::RegEx()
{
pdata = new re_detail::RegExData();
pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
}
RegEx::RegEx(const RegEx& o)
{
pdata = new re_detail::RegExData(*(o.pdata));
pdata = new BOOST_REGEX_DETAIL_NS::RegExData(*(o.pdata));
}
RegEx::~RegEx()
@ -156,13 +156,13 @@ RegEx::~RegEx()
RegEx::RegEx(const char* c, bool icase)
{
pdata = new re_detail::RegExData();
pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
SetExpression(c, icase);
}
RegEx::RegEx(const std::string& s, bool icase)
{
pdata = new re_detail::RegExData();
pdata = new BOOST_REGEX_DETAIL_NS::RegExData();
SetExpression(s.c_str(), icase);
}
@ -200,7 +200,7 @@ std::string RegEx::Expression()const
//
bool RegEx::Match(const char* p, match_flag_type flags)
{
pdata->t = re_detail::RegExData::type_pc;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
@ -215,7 +215,7 @@ bool RegEx::Match(const char* p, match_flag_type flags)
bool RegEx::Search(const char* p, match_flag_type flags)
{
pdata->t = re_detail::RegExData::type_pc;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
@ -227,7 +227,7 @@ bool RegEx::Search(const char* p, match_flag_type flags)
}
return false;
}
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
struct pred1
{
GrepCallback cb;
@ -242,17 +242,17 @@ struct pred1
}
unsigned int RegEx::Grep(GrepCallback cb, const char* p, match_flag_type flags)
{
pdata->t = re_detail::RegExData::type_pc;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
unsigned int result = regex_grep(re_detail::pred1(cb, this), p, end, pdata->e, flags);
unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred1(cb, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
struct pred2
{
std::vector<std::string>& v;
@ -271,17 +271,17 @@ private:
unsigned int RegEx::Grep(std::vector<std::string>& v, const char* p, match_flag_type flags)
{
pdata->t = re_detail::RegExData::type_pc;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
unsigned int result = regex_grep(re_detail::pred2(v, this), p, end, pdata->e, flags);
unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred2(v, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
struct pred3
{
std::vector<std::size_t>& v;
@ -300,18 +300,18 @@ private:
}
unsigned int RegEx::Grep(std::vector<std::size_t>& v, const char* p, match_flag_type flags)
{
pdata->t = re_detail::RegExData::type_pc;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pc;
pdata->pbase = p;
const char* end = p;
while(*end)++end;
unsigned int result = regex_grep(re_detail::pred3(v, p, this), p, end, pdata->e, flags);
unsigned int result = regex_grep(BOOST_REGEX_DETAIL_NS::pred3(v, p, this), p, end, pdata->e, flags);
if(result)
pdata->update();
return result;
}
#ifndef BOOST_REGEX_NO_FILEITER
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
struct pred4
{
GrepFileCallback cb;
@ -338,17 +338,17 @@ void BuildFileList(std::list<std::string>* pl, const char* files, bool recurse)
{
// go through sub directories:
char buf[MAX_PATH];
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, start.root()));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, start.root()));
if(*buf == 0)
{
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(buf, MAX_PATH, "."));
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*"));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(buf, MAX_PATH, "."));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*"));
}
else
{
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(buf, MAX_PATH, "*"));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, directory_iterator::separator()));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(buf, MAX_PATH, "*"));
}
directory_iterator dstart(buf);
directory_iterator dend;
@ -403,9 +403,9 @@ unsigned int RegEx::GrepFiles(GrepFileCallback cb, const char* files, bool recur
while(start != end)
{
mapfile map((*start).c_str());
pdata->t = re_detail::RegExData::type_pf;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf;
pdata->fbase = map.begin();
re_detail::pred4 pred(cb, this, (*start).c_str());
BOOST_REGEX_DETAIL_NS::pred4 pred(cb, this, (*start).c_str());
int r = regex_grep(pred, map.begin(), map.end(), pdata->e, flags);
result += r;
++start;
@ -430,7 +430,7 @@ unsigned int RegEx::FindFiles(FindFilesCallback cb, const char* files, bool recu
while(start != end)
{
mapfile map((*start).c_str());
pdata->t = re_detail::RegExData::type_pf;
pdata->t = BOOST_REGEX_DETAIL_NS::RegExData::type_pf;
pdata->fbase = map.begin();
if(regex_search(map.begin(), map.end(), pdata->fm, pdata->e, flags))
@ -456,7 +456,7 @@ std::string RegEx::Merge(const std::string& in, const std::string& fmt,
bool copy, match_flag_type flags)
{
std::string result;
re_detail::string_out_iterator<std::string> i(result);
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::string> i(result);
if(!copy) flags |= format_no_copy;
regex_replace(i, in.begin(), in.end(), pdata->e, fmt.c_str(), flags);
return result;
@ -467,7 +467,7 @@ std::string RegEx::Merge(const char* in, const char* fmt,
{
std::string result;
if(!copy) flags |= format_no_copy;
re_detail::string_out_iterator<std::string> i(result);
BOOST_REGEX_DETAIL_NS::string_out_iterator<std::string> i(result);
regex_replace(i, in, in + std::strlen(in), pdata->e, fmt, flags);
return result;
}
@ -489,13 +489,13 @@ std::size_t RegEx::Position(int i)const
{
switch(pdata->t)
{
case re_detail::RegExData::type_pc:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched ? pdata->m[i].first - pdata->pbase : RegEx::npos;
#ifndef BOOST_REGEX_NO_FILEITER
case re_detail::RegExData::type_pf:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched ? pdata->fm[i].first - pdata->fbase : RegEx::npos;
#endif
case re_detail::RegExData::type_copy:
case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::ptrdiff_t, std::less<int> >::iterator pos = pdata->positions.find(i);
if(pos == pdata->positions.end())
@ -516,13 +516,13 @@ std::size_t RegEx::Length(int i)const
{
switch(pdata->t)
{
case re_detail::RegExData::type_pc:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched ? pdata->m[i].second - pdata->m[i].first : RegEx::npos;
#ifndef BOOST_REGEX_NO_FILEITER
case re_detail::RegExData::type_pf:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched ? pdata->fm[i].second - pdata->fm[i].first : RegEx::npos;
#endif
case re_detail::RegExData::type_copy:
case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos == pdata->strings.end())
@ -537,13 +537,13 @@ bool RegEx::Matched(int i)const
{
switch(pdata->t)
{
case re_detail::RegExData::type_pc:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
return pdata->m[i].matched;
#ifndef BOOST_REGEX_NO_FILEITER
case re_detail::RegExData::type_pf:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
return pdata->fm[i].matched;
#endif
case re_detail::RegExData::type_copy:
case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos == pdata->strings.end())
@ -560,15 +560,15 @@ std::string RegEx::What(int i)const
std::string result;
switch(pdata->t)
{
case re_detail::RegExData::type_pc:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pc:
if(pdata->m[i].matched)
result.assign(pdata->m[i].first, pdata->m[i].second);
break;
case re_detail::RegExData::type_pf:
case BOOST_REGEX_DETAIL_NS::RegExData::type_pf:
if(pdata->m[i].matched)
result.assign(to_string(pdata->m[i].first, pdata->m[i].second));
break;
case re_detail::RegExData::type_copy:
case BOOST_REGEX_DETAIL_NS::RegExData::type_copy:
{
std::map<int, std::string, std::less<int> >::iterator pos = pdata->strings.find(i);
if(pos != pdata->strings.end())

View File

@ -58,7 +58,7 @@ namespace std{
#endif
namespace boost{
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
// start with the operating system specific stuff:
#if (defined(__BORLANDC__) || defined(BOOST_REGEX_FI_WIN32_DIR) || defined(BOOST_MSVC)) && !defined(BOOST_RE_NO_WIN32)
@ -110,7 +110,7 @@ void mapfile::open(const char* file)
hmap = 0;
hfile = 0;
std::runtime_error err("Unable to create file mapping.");
boost::re_detail::raise_runtime_error(err);
boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
_first = static_cast<const char*>(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0));
if(_first == 0)
@ -397,9 +397,9 @@ inline void copy_find_file_result_with_overflow_check(const _fi_find_data& data,
{
#ifdef BOOST_NO_ANSI_APIS
if (::WideCharToMultiByte(CP_ACP, 0, data.cFileName, -1, path, max_size, NULL, NULL) == 0)
re_detail::overflow_error_if_not_zero(1);
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(1);
#else
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(path, max_size, data.cFileName));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(path, max_size, data.cFileName));
#endif
}
@ -454,22 +454,22 @@ file_iterator::file_iterator(const char* wild)
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild));
ptr = _root;
while(*ptr)++ptr;
while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr;
if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) )
{
_root[1]='\0';
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
}
else
{
*ptr = 0;
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
if(*_path == 0)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, "."));
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, "."));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep));
}
ptr = _path + std::strlen(_path);
@ -512,8 +512,8 @@ file_iterator::file_iterator(const file_iterator& other)
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
ref = other.ref;
#ifndef BOOST_NO_EXCEPTIONS
@ -530,8 +530,8 @@ file_iterator::file_iterator(const file_iterator& other)
file_iterator& file_iterator::operator=(const file_iterator& other)
{
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
if(--(ref->count) == 0)
{
@ -632,7 +632,7 @@ directory_iterator::directory_iterator(const char* wild)
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, wild));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, wild));
ptr = _root;
while(*ptr)++ptr;
while((ptr > _root) && (*ptr != *_fi_sep) && (*ptr != *_fi_sep_alt))--ptr;
@ -640,15 +640,15 @@ directory_iterator::directory_iterator(const char* wild)
if((ptr == _root) && ( (*ptr== *_fi_sep) || (*ptr==*_fi_sep_alt) ) )
{
_root[1]='\0';
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
}
else
{
*ptr = 0;
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, _root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, _root));
if(*_path == 0)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, "."));
re_detail::overflow_error_if_not_zero(re_detail::strcat_s(_path, MAX_PATH, _fi_sep));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, "."));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcat_s(_path, MAX_PATH, _fi_sep));
}
ptr = _path + std::strlen(_path);
@ -702,8 +702,8 @@ directory_iterator::directory_iterator(const directory_iterator& other)
BOOST_REGEX_NOEH_ASSERT(_root)
_path = new char[MAX_PATH];
BOOST_REGEX_NOEH_ASSERT(_path)
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
ref = other.ref;
#ifndef BOOST_NO_EXCEPTIONS
@ -720,8 +720,8 @@ directory_iterator::directory_iterator(const directory_iterator& other)
directory_iterator& directory_iterator::operator=(const directory_iterator& other)
{
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_root, MAX_PATH, other._root));
re_detail::overflow_error_if_not_zero(re_detail::strcpy_s(_path, MAX_PATH, other._path));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_root, MAX_PATH, other._root));
BOOST_REGEX_DETAIL_NS::overflow_error_if_not_zero(BOOST_REGEX_DETAIL_NS::strcpy_s(_path, MAX_PATH, other._path));
ptr = _path + (other.ptr - other._path);
if(--(ref->count) == 0)
{
@ -910,7 +910,7 @@ bool _fi_FindClose(_fi_find_handle dat)
#endif
} // namespace re_detail
} // namespace BOOST_REGEX_DETAIL_NS
} // namspace boost
#endif // BOOST_REGEX_NO_FILEITER

View File

@ -28,7 +28,7 @@
namespace boost{
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
icu_regex_traits_implementation::string_type icu_regex_traits_implementation::do_transform(const char_type* p1, const char_type* p2, const U_NAMESPACE_QUALIFIER Collator* pcoll) const
{
@ -191,7 +191,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha
/* zs */ 'z', 's',
};
static const re_detail::character_pointer_range< ::UChar32> range_data[] = {
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> range_data[] = {
{ prop_name_table+0, prop_name_table+3, }, // any
{ prop_name_table+3, prop_name_table+8, }, // ascii
{ prop_name_table+8, prop_name_table+16, }, // assigned
@ -354,11 +354,11 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_icu_mask(const ::UCha
};
static const re_detail::character_pointer_range< ::UChar32>* ranges_begin = range_data;
static const re_detail::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_begin = range_data;
static const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* ranges_end = range_data + (sizeof(range_data)/sizeof(range_data[0]));
re_detail::character_pointer_range< ::UChar32> t = { p1, p2, };
const re_detail::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32> t = { p1, p2, };
const BOOST_REGEX_DETAIL_NS::character_pointer_range< ::UChar32>* p = std::lower_bound(ranges_begin, ranges_end, t);
if((p != ranges_end) && (t == *p))
return icu_class_map[p - ranges_begin];
return 0;
@ -392,7 +392,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_
char_class_type(U_GC_ND_MASK) | mask_xdigit,
};
int idx = ::boost::re_detail::get_default_class_id(p1, p2);
int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx >= 0)
return masks[idx+1];
char_class_type result = lookup_icu_mask(p1, p2);
@ -415,7 +415,7 @@ icu_regex_traits::char_class_type icu_regex_traits::lookup_classname(const char_
}
}
if(s.size())
idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
if(idx >= 0)
return masks[idx+1];
if(s.size())
@ -457,7 +457,7 @@ icu_regex_traits::string_type icu_regex_traits::lookup_collatename(const char_ty
return result;
}
// try POSIX name:
s = ::boost::re_detail::lookup_default_collate_name(s);
s = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(s);
#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
result.assign(s.begin(), s.end());
#else
@ -495,9 +495,9 @@ bool icu_regex_traits::isctype(char_type c, char_class_type f) const
return true;
if(((f & mask_ascii) != 0) && (c <= 0x7F))
return true;
if(((f & mask_vertical) != 0) && (::boost::re_detail::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK)))
if(((f & mask_vertical) != 0) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == static_cast<char_type>('\v')) || (m == U_GC_ZL_MASK) || (m == U_GC_ZP_MASK)))
return true;
if(((f & mask_horizontal) != 0) && !::boost::re_detail::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v')))
if(((f & mask_horizontal) != 0) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && u_isspace(c) && (c != static_cast<char_type>('\v')))
return true;
return false;
}

View File

@ -154,7 +154,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
{
result = std::strlen(names[code]) + 1;
if(buf_size >= result)
re_detail::strcpy_s(buf, buf_size, names[code]);
BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, names[code]);
return result;
}
return result;
@ -180,7 +180,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
if(r < 0)
return 0; // sprintf failed
if(std::strlen(localbuf) < buf_size)
re_detail::strcpy_s(buf, buf_size, localbuf);
BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf);
return std::strlen(localbuf) + 1;
}
}
@ -190,7 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
(std::sprintf)(localbuf, "%d", 0);
#endif
if(std::strlen(localbuf) < buf_size)
re_detail::strcpy_s(buf, buf_size, localbuf);
BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, localbuf);
return std::strlen(localbuf) + 1;
}
if(code <= (int)REG_E_UNKNOWN)
@ -200,12 +200,12 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
p = static_cast<c_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
else
{
p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
}
std::size_t len = p.size();
if(len < buf_size)
{
re_detail::strcpy_s(buf, buf_size, p.c_str());
BOOST_REGEX_DETAIL_NS::strcpy_s(buf, buf_size, p.c_str());
}
return len + 1;
}

View File

@ -64,7 +64,7 @@ regex_error::regex_error(const std::string& s, regex_constants::error_type err,
}
regex_error::regex_error(regex_constants::error_type err)
: std::runtime_error(::boost::re_detail::get_default_error_string(err))
: std::runtime_error(::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(err))
, m_error_code(err)
, m_position(0)
{
@ -83,7 +83,7 @@ void regex_error::raise()const
namespace re_detail{
namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex)
{
@ -211,7 +211,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
#endif
} // namespace re_detail
} // namespace BOOST_REGEX_DETAIL_NS

View File

@ -32,7 +32,7 @@ namespace std{
#endif
namespace boost{ namespace re_detail{
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
void BOOST_REGEX_CALL raw_storage::resize(size_type n)
{

View File

@ -36,7 +36,7 @@ namespace std{
#endif
namespace boost{ namespace re_detail{
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants::syntax_type n)
{
@ -688,5 +688,5 @@ BOOST_REGEX_DECL regex_constants::syntax_type BOOST_REGEX_CALL get_default_synta
}
} // re_detail
} // BOOST_REGEX_DETAIL_NS
} // boost

View File

@ -40,7 +40,7 @@ namespace std{
}
#endif
namespace boost{ namespace re_detail{
namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
#ifdef BOOST_NO_ANSI_APIS
UINT get_code_page_for_locale_id(lcid_type idx)
@ -63,12 +63,12 @@ void w32_regex_traits_char_layer<char>::init()
std::string cat_name(w32_regex_traits<char>::get_catalog_name());
if(cat_name.size())
{
cat = ::boost::re_detail::w32_cat_open(cat_name);
cat = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_open(cat_name);
if(!cat)
{
std::string m("Unable to open message catalog: ");
std::runtime_error err(m + cat_name);
::boost::re_detail::raise_runtime_error(err);
::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err);
}
}
//
@ -78,7 +78,7 @@ void w32_regex_traits_char_layer<char>::init()
{
for(regex_constants::syntax_type i = 1; i < regex_constants::syntax_max; ++i)
{
string_type mss = ::boost::re_detail::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i));
string_type mss = ::boost::BOOST_REGEX_DETAIL_NS::w32_cat_get(cat, this->m_locale, i, get_default_syntax(i));
for(string_type::size_type j = 0; j < mss.size(); ++j)
{
m_char_map[static_cast<unsigned char>(mss[j])] = i;
@ -105,9 +105,9 @@ void w32_regex_traits_char_layer<char>::init()
{
if(m_char_map[i] == 0)
{
if(::boost::re_detail::w32_is(this->m_locale, 0x0002u, (char)i))
if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0002u, (char)i))
m_char_map[i] = regex_constants::escape_type_class;
else if(::boost::re_detail::w32_is(this->m_locale, 0x0001u, (char)i))
else if(::boost::BOOST_REGEX_DETAIL_NS::w32_is(this->m_locale, 0x0001u, (char)i))
m_char_map[i] = regex_constants::escape_type_not_class;
}
}while(0xFF != i++);
@ -645,7 +645,7 @@ BOOST_REGEX_DECL bool BOOST_REGEX_CALL w32_is(lcid_type idx, boost::uint32_t m,
#endif
#endif
} // re_detail
} // BOOST_REGEX_DETAIL_NS
} // boost
#endif

View File

@ -117,7 +117,7 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::t
c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::transform_primary(const wchar_t* p1, const wchar_t* p2)
{
static wchar_t s_delim;
static const int s_collate_type = ::boost::re_detail::find_sort_syntax(static_cast<const c_regex_traits<wchar_t>*>(0), &s_delim);
static const int s_collate_type = ::boost::BOOST_REGEX_DETAIL_NS::find_sort_syntax(static_cast<const c_regex_traits<wchar_t>*>(0), &s_delim);
std::wstring result;
//
// What we do here depends upon the format of the sort key returned by
@ -125,8 +125,8 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::t
//
switch(s_collate_type)
{
case ::boost::re_detail::sort_C:
case ::boost::re_detail::sort_unknown:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_C:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_unknown:
// the best we can do is translate to lower case, then get a regular sort key:
{
result.assign(p1, p2);
@ -135,14 +135,14 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::t
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
break;
}
case ::boost::re_detail::sort_fixed:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_fixed:
{
// get a regular sort key, and then truncate it:
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
result.erase(s_delim);
break;
}
case ::boost::re_detail::sort_delim:
case ::boost::BOOST_REGEX_DETAIL_NS::sort_delim:
// get a regular sort key, and then truncate everything after the delim:
result = c_regex_traits<wchar_t>::transform(&*result.begin(), &*result.begin() + result.size());
if(result.size() && (result[0] == s_delim))
@ -189,13 +189,13 @@ c_regex_traits<wchar_t>::char_class_type BOOST_REGEX_CALL c_regex_traits<wchar_t
char_class_xdigit,
};
int idx = ::boost::re_detail::get_default_class_id(p1, p2);
int idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(idx < 0)
{
std::wstring s(p1, p2);
for(std::wstring::size_type i = 0; i < s.size(); ++i)
s[i] = (std::towlower)(s[i]);
idx = ::boost::re_detail::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
idx = ::boost::BOOST_REGEX_DETAIL_NS::get_default_class_id(&*s.begin(), &*s.begin() + s.size());
}
BOOST_ASSERT(idx+1 < static_cast<int>(sizeof(masks) / sizeof(masks[0])));
return masks[idx+1];
@ -213,11 +213,11 @@ bool BOOST_REGEX_CALL c_regex_traits<wchar_t>::isctype(wchar_t c, char_class_typ
|| ((mask & char_class_digit) && (std::iswdigit)(c))
|| ((mask & char_class_punct) && (std::iswpunct)(c))
|| ((mask & char_class_xdigit) && (std::iswxdigit)(c))
|| ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c))
|| ((mask & char_class_blank) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c))
|| ((mask & char_class_word) && (c == '_'))
|| ((mask & char_class_unicode) && (c & ~static_cast<wchar_t>(0xff)))
|| ((mask & char_class_vertical) && (::boost::re_detail::is_separator(c) || (c == L'\v')))
|| ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::re_detail::is_separator(c) && (c != L'\v'));
|| ((mask & char_class_vertical) && (::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) || (c == L'\v')))
|| ((mask & char_class_horizontal) && (std::iswspace)(c) && !::boost::BOOST_REGEX_DETAIL_NS::is_separator(c) && (c != L'\v'));
}
c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::lookup_collatename(const wchar_t* p1, const wchar_t* p2)
@ -232,7 +232,7 @@ c_regex_traits<wchar_t>::string_type BOOST_REGEX_CALL c_regex_traits<wchar_t>::l
while(p0 != p2)
name.append(1, char(*p0++));
#endif
name = ::boost::re_detail::lookup_default_collate_name(name);
name = ::boost::BOOST_REGEX_DETAIL_NS::lookup_default_collate_name(name);
#if !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)\
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1300)\
&& !BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)

View File

@ -218,12 +218,12 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
p = static_cast<wc_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
else
{
p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
p = BOOST_REGEX_DETAIL_NS::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
}
std::size_t len = p.size();
if(len < buf_size)
{
re_detail::copy(p.c_str(), p.c_str() + p.size() + 1, buf);
BOOST_REGEX_DETAIL_NS::copy(p.c_str(), p.c_str() + p.size() + 1, buf);
}
return len + 1;
}