update boost on linux

This commit is contained in:
Bassem Girgis
2019-08-10 16:06:25 -05:00
parent 76ad52be58
commit 861b918727
5363 changed files with 483306 additions and 116507 deletions

View File

@@ -58,6 +58,11 @@ namespace boost { namespace spirit { namespace x3
return pos_cache.position_of(pos);
}
position_cache<std::vector<Iterator>> const& get_position_cache() const
{
return pos_cache;
}
private:
void print_file_line(std::size_t line) const;
@@ -178,7 +183,7 @@ namespace boost { namespace spirit { namespace x3
if (prev != '\r') ++line;
break;
case '\r':
if (prev != '\n') ++line;
++line;
break;
default:
break;

View File

@@ -230,7 +230,7 @@ namespace boost { namespace spirit { namespace x3 { namespace testing
std::string output = f(load(input_path), input_path);
std::string expected = load(expect_path);
auto result = compare(output, expected);
auto result = compare(output, expected, re_prefix, re_suffix);
if (!result.full_match)
{
std::cout << "=============================================" << std::endl;

View File

@@ -62,6 +62,44 @@ namespace boost { namespace spirit { namespace x3
}
return result;
}
// Assume wchar_t content is UTF-16 on Windows and UCS-4 on Unix
#if defined(_WIN32) || defined(__CYGWIN__)
inline utf8_string to_utf8(wchar_t value)
{
utf8_string result;
typedef std::back_insert_iterator<utf8_string> insert_iter;
insert_iter out_iter(result);
utf8_output_iterator<insert_iter> utf8_iter(out_iter);
u16_to_u32_iterator<wchar_t const*, ucs4_char> ucs4_iter(&value);
*utf8_iter++ = *ucs4_iter;
return result;
}
inline utf8_string to_utf8(wchar_t const* str)
{
utf8_string result;
typedef std::back_insert_iterator<utf8_string> insert_iter;
insert_iter out_iter(result);
utf8_output_iterator<insert_iter> utf8_iter(out_iter);
u16_to_u32_iterator<wchar_t const*, ucs4_char> ucs4_iter(str);
for (ucs4_char c; (c = *ucs4_iter) != ucs4_char(); ++ucs4_iter) {
*utf8_iter++ = c;
}
return result;
}
template <typename Traits, typename Allocator>
inline utf8_string
to_utf8(std::basic_string<wchar_t, Traits, Allocator> const& str)
{
return to_utf8(str.c_str());
}
#endif
}}}
#endif