Merged accumulated patches from Trunk.

[SVN r62831]
This commit is contained in:
John Maddock
2010-06-12 08:30:11 +00:00
parent 61f4b3360f
commit 9529cb8bc0
91 changed files with 4251 additions and 4062 deletions

View File

@ -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 [

View File

@ -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;

View File

@ -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

View File

@ -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:

View File

@ -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:

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{

View File

@ -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))
{