mirror of
https://github.com/boostorg/regex.git
synced 2025-07-23 00:57:19 +02:00
Merged accumulated patches from Trunk.
[SVN r62831]
This commit is contained in:
@ -10,9 +10,12 @@ project
|
||||
# There are unidentified linker problems on these platforms:
|
||||
<toolset>mipspro-7.4:<link>static
|
||||
<toolset>sun-5.9:<link>static
|
||||
<toolset>msvc:<warnings>all
|
||||
<toolset>gcc:<warnings>all
|
||||
<toolset>gcc:<cxxflags>-Wextra
|
||||
<define>U_USING_ICU_NAMESPACE=0
|
||||
;
|
||||
|
||||
|
||||
rule regex-test-run ( sources + : input * : name * )
|
||||
{
|
||||
return [
|
||||
|
@ -13,9 +13,14 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <boost/program_options.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4512 4244)
|
||||
#endif
|
||||
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
namespace po = boost::program_options;
|
||||
|
||||
int after_context;
|
||||
|
@ -152,9 +152,15 @@ int main()
|
||||
assert(file == "d.h");
|
||||
|
||||
// Greek text extraction with u32regex_search:
|
||||
U_NAMESPACE_QUALIFIER UnicodeString text = L"Some where in \x0391\x039D\x0395\x0398\x0391 2004";
|
||||
const UChar t[] = {
|
||||
'S', 'o', 'm', 'e', ' ', 'w', 'h', 'e', 'r', 'e', ' ', 'i', 'n', 0x0391, 0x039D, 0x0395, 0x0398, 0x0391, 0
|
||||
};
|
||||
const UChar g[] = {
|
||||
0x0391, 0x039D, 0x0395, 0x0398, 0x0391, 0
|
||||
};
|
||||
U_NAMESPACE_QUALIFIER UnicodeString text = t;
|
||||
U_NAMESPACE_QUALIFIER UnicodeString greek = extract_greek(text);
|
||||
assert(greek == L"\x0391\x039D\x0395\x0398\x0391 2004");
|
||||
assert(greek == g);
|
||||
|
||||
// extract currency symbols with associated value, use iterator interface:
|
||||
std::string text2 = " $100.23 or \xC2\xA3""198.12 "; // \xC2\xA3 is the pound sign encoded in UTF-8
|
||||
|
@ -61,7 +61,7 @@ void search(std::istream& is)
|
||||
std::memmove(buf, next_pos, leftover);
|
||||
// fill the rest from the stream:
|
||||
is.read(buf + leftover, size);
|
||||
unsigned read = is.gcount();
|
||||
std::streamsize read = is.gcount();
|
||||
// check to see if we've run out of text:
|
||||
have_more = read == size;
|
||||
// reset next_pos:
|
||||
|
@ -51,7 +51,7 @@ void search(std::istream& is)
|
||||
std::memmove(buf, next_pos, leftover);
|
||||
// fill the rest from the stream:
|
||||
is.read(buf + leftover, size);
|
||||
unsigned read = is.gcount();
|
||||
std::streamsize read = is.gcount();
|
||||
// check to see if we've run out of text:
|
||||
have_more = read == size;
|
||||
// reset next_pos:
|
||||
|
@ -89,7 +89,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -107,7 +107,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
{
|
||||
s.erase();
|
||||
if(is.bad()) return;
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -33,7 +33,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
//
|
||||
// attempt to grow string buffer to match file size,
|
||||
// this doesn't always work...
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ void load_file(std::string& s, std::istream& is)
|
||||
//
|
||||
// attempt to grow string buffer to match file size,
|
||||
// this doesn't always work...
|
||||
s.reserve(is.rdbuf()->in_avail());
|
||||
s.reserve(static_cast<std::string::size_type>(is.rdbuf()->in_avail()));
|
||||
char c;
|
||||
while(is.get(c))
|
||||
{
|
||||
|
Reference in New Issue
Block a user