>
class basic_filebuf;
-
+
///
/// \brief This is implementation of std::filebuf
///
@@ -48,7 +48,7 @@ namespace nowide {
///
/// Creates new filebuf
///
- basic_filebuf() :
+ basic_filebuf() :
buffer_size_(4),
buffer_(0),
file_(0),
@@ -58,7 +58,7 @@ namespace nowide {
setg(0,0,0);
setp(0,0);
}
-
+
virtual ~basic_filebuf()
{
if(file_) {
@@ -68,7 +68,7 @@ namespace nowide {
if(own_ && buffer_)
delete [] buffer_;
}
-
+
///
/// Same as std::filebuf::open but s is UTF-8 string
///
@@ -139,7 +139,7 @@ namespace nowide {
}
}
protected:
-
+
virtual std::streambuf *setbuf(char *s,std::streamsize n)
{
if(!buffer_ && n>=0) {
@@ -149,68 +149,12 @@ namespace nowide {
}
return this;
}
-
-#ifdef BOOST_NOWIDE_DEBUG_FILEBUF
- void print_buf(char *b,char *p,char *e)
- {
- std::cerr << "-- Is Null: " << (b==0) << std::endl;;
- if(b==0)
- return;
- if(e != 0)
- std::cerr << "-- Total: " << e - b <<" offset from start " << p - b << std::endl;
- else
- std::cerr << "-- Total: " << p - b << std::endl;
-
- std::cerr << "-- [";
- for(char *ptr = b;ptrprint_state();
- }
- ~print_guard()
- {
- std::cerr << "Out: " << f << std::endl;
- self->print_state();
- }
- basic_filebuf *self;
- char const *f;
- };
-#else
-#endif
-
int overflow(int c)
{
-#ifdef BOOST_NOWIDE_DEBUG_FILEBUF
- print_guard g(this,__FUNCTION__);
-#endif
if(!file_)
return EOF;
-
+
if(fixg() < 0)
return EOF;
@@ -234,8 +178,8 @@ namespace nowide {
}
return 0;
}
-
-
+
+
int sync()
{
return overflow(EOF);
@@ -243,9 +187,6 @@ namespace nowide {
int underflow()
{
-#ifdef BOOST_NOWIDE_DEBUG_FILEBUF
- print_guard g(this,__FUNCTION__);
-#endif
if(!file_)
return EOF;
if(fixp() < 0)
@@ -276,9 +217,6 @@ namespace nowide {
std::ios_base::seekdir seekdir,
std::ios_base::openmode /*m*/)
{
-#ifdef BOOST_NOWIDE_DEBUG_FILEBUF
- print_guard g(this,__FUNCTION__);
-#endif
if(!file_)
return EOF;
if(fixp() < 0 || fixg() < 0)
@@ -315,7 +253,7 @@ namespace nowide {
setg(0,0,0);
return 0;
}
-
+
int fixp()
{
if(pptr()!=0) {
@@ -335,8 +273,8 @@ namespace nowide {
}
file_ = f;
}
-
-
+
+
static wchar_t const *get_mode(std::ios_base::openmode mode)
{
//
@@ -381,9 +319,9 @@ namespace nowide {
return L"a+b";
if(mode == (std::ios_base::binary | std::ios_base::in | std::ios_base::app))
return L"a+b";
- return 0;
+ return 0;
}
-
+
size_t buffer_size_;
char *buffer_;
FILE *file_;
@@ -391,14 +329,14 @@ namespace nowide {
char last_char_;
std::ios::openmode mode_;
};
-
+
///
/// \brief Convinience typedef
///
typedef basic_filebuf filebuf;
-
+
#endif // windows
-
+
} // nowide
} // namespace boost
diff --git a/include/boost/nowide/fstream.hpp b/include/boost/nowide/fstream.hpp
index 10265e5..dbcd214 100644
--- a/include/boost/nowide/fstream.hpp
+++ b/include/boost/nowide/fstream.hpp
@@ -43,30 +43,30 @@ namespace nowide {
typedef basic_filebuf internal_buffer_type;
typedef std::basic_istream internal_stream_type;
- basic_ifstream() :
+ basic_ifstream() :
internal_stream_type(0)
{
buf_.reset(new internal_buffer_type());
std::ios::rdbuf(buf_.get());
}
-
- explicit basic_ifstream(char const *file_name,std::ios_base::openmode mode = std::ios_base::in) :
- internal_stream_type(0)
+
+ explicit basic_ifstream(char const *file_name,std::ios_base::openmode mode = std::ios_base::in) :
+ internal_stream_type(0)
{
buf_.reset(new internal_buffer_type());
std::ios::rdbuf(buf_.get());
open(file_name,mode);
}
- explicit basic_ifstream(std::string const &file_name,std::ios_base::openmode mode = std::ios_base::in) :
- internal_stream_type(0)
+ explicit basic_ifstream(std::string const &file_name,std::ios_base::openmode mode = std::ios_base::in) :
+ internal_stream_type(0)
{
buf_.reset(new internal_buffer_type());
std::ios::rdbuf(buf_.get());
open(file_name,mode);
}
-
+
void open(std::string const &file_name,std::ios_base::openmode mode = std::ios_base::in)
{
open(file_name.c_str(),mode);
@@ -104,7 +104,7 @@ namespace nowide {
{
buf_->close();
}
-
+
private:
boost::scoped_ptr buf_;
};
@@ -120,7 +120,7 @@ namespace nowide {
typedef basic_filebuf internal_buffer_type;
typedef std::basic_ostream internal_stream_type;
- basic_ofstream() :
+ basic_ofstream() :
internal_stream_type(0)
{
buf_.reset(new internal_buffer_type());
@@ -177,7 +177,7 @@ namespace nowide {
{
buf_->close();
}
-
+
private:
boost::scoped_ptr buf_;
};
@@ -193,7 +193,7 @@ namespace nowide {
typedef basic_filebuf internal_buffer_type;
typedef std::basic_iostream internal_stream_type;
- basic_fstream() :
+ basic_fstream() :
internal_stream_type(0)
{
buf_.reset(new internal_buffer_type());
@@ -250,7 +250,7 @@ namespace nowide {
{
buf_->close();
}
-
+
private:
boost::scoped_ptr buf_;
};
diff --git a/include/boost/nowide/iostream.hpp b/include/boost/nowide/iostream.hpp
index 6ab004a..0bc8643 100644
--- a/include/boost/nowide/iostream.hpp
+++ b/include/boost/nowide/iostream.hpp
@@ -14,6 +14,8 @@
#include
#include
+#include // must be the last #include
+
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable : 4251)
@@ -28,12 +30,12 @@ namespace nowide {
using std::cin;
using std::clog;
#else
-
- /// \cond INTERNAL
+
+ /// \cond INTERNAL
namespace details {
class console_output_buffer;
class console_input_buffer;
-
+
class BOOST_NOWIDE_DECL winconsole_ostream : public std::ostream {
winconsole_ostream(winconsole_ostream const &);
void operator=(winconsole_ostream const &);
@@ -48,40 +50,39 @@ namespace nowide {
winconsole_istream(winconsole_istream const &);
void operator=(winconsole_istream const &);
public:
-
+
winconsole_istream();
~winconsole_istream();
private:
- struct data;
boost::scoped_ptr d;
};
- } // details
-
+ } // details
+
/// \endcond
///
/// \brief Same as std::cin, but uses UTF-8
///
/// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
- ///
+ ///
extern BOOST_NOWIDE_DECL details::winconsole_istream cin;
///
/// \brief Same as std::cout, but uses UTF-8
///
/// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
- ///
+ ///
extern BOOST_NOWIDE_DECL details::winconsole_ostream cout;
///
/// \brief Same as std::cerr, but uses UTF-8
///
/// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
- ///
+ ///
extern BOOST_NOWIDE_DECL details::winconsole_ostream cerr;
///
/// \brief Same as std::clog, but uses UTF-8
///
/// Note, the stream is not synchronized with stdio and not affected by std::ios::sync_with_stdio
- ///
+ ///
extern BOOST_NOWIDE_DECL details::winconsole_ostream clog;
#endif
@@ -93,6 +94,7 @@ namespace nowide {
# pragma warning(pop)
#endif
+#include // pops abi_prefix.hpp pragmas
#endif
///
diff --git a/include/boost/nowide/stackstring.hpp b/include/boost/nowide/stackstring.hpp
index 0317842..f201d4e 100644
--- a/include/boost/nowide/stackstring.hpp
+++ b/include/boost/nowide/stackstring.hpp
@@ -21,16 +21,16 @@ namespace nowide {
/// and allocated a buffer on the heap if the size of the buffer is too small
///
/// If invalid UTF charracters are detected they are replaced with U+FFFD substutution charracter
-///
+///
template
class basic_stackstring {
public:
-
- static const size_t buffer_size = BufferSize;
+
+ static const size_t buffer_size = BufferSize;
typedef CharOut output_char;
typedef CharIn input_char;
- basic_stackstring(basic_stackstring const &other) :
+ basic_stackstring(basic_stackstring const &other) :
mem_buffer_(0)
{
clear();
@@ -45,7 +45,7 @@ public:
std::memcpy(buffer_,other.buffer_,buffer_size * sizeof(output_char));
}
}
-
+
void swap(basic_stackstring &other)
{
std::swap(mem_buffer_,other.mem_buffer_);
@@ -56,7 +56,7 @@ public:
{
if(this != &other) {
basic_stackstring tmp(other);
- swap(tmp);
+ swap(tmp);
}
return *this;
}
@@ -116,11 +116,11 @@ private:
{
if(insize <= outsize)
return in;
- else if(insize == 2 && outsize == 1)
+ else if(insize == 2 && outsize == 1)
return 3 * in;
- else if(insize == 4 && outsize == 1)
+ else if(insize == 4 && outsize == 1)
return 4 * in;
- else // if(insize == 4 && outsize == 2)
+ else // if(insize == 4 && outsize == 2)
return 2 * in;
}
output_char buffer_[buffer_size];
diff --git a/include/boost/nowide/utf8_codecvt.hpp b/include/boost/nowide/utf8_codecvt.hpp
index 1f711ab..54a2783 100644
--- a/include/boost/nowide/utf8_codecvt.hpp
+++ b/include/boost/nowide/utf8_codecvt.hpp
@@ -44,9 +44,6 @@ protected:
virtual std::codecvt_base::result do_unshift(std::mbstate_t &s,char *from,char * /*to*/,char *&next) const
{
boost::uint16_t &state = *reinterpret_cast(&s);
-#ifdef DEBUG_CODECVT
- std::cout << "Entering unshift " << std::hex << state << std::dec << std::endl;
-#endif
if(state != 0)
return std::codecvt_base::error;
next=from;
@@ -130,11 +127,6 @@ protected:
boost::uint16_t &state = *reinterpret_cast(&std_state);
while(to < to_end && from < from_end)
{
-#ifdef DEBUG_CODECVT
- std::cout << "Entering IN--------------" << std::endl;
- std::cout << "State " << std::hex << state <::decode(from,from_end);
@@ -181,25 +173,6 @@ protected:
to_next=to;
if(r == std::codecvt_base::ok && (from!=from_end || state!=0))
r = std::codecvt_base::partial;
-#ifdef DEBUG_CODECVT
- std::cout << "Returning ";
- switch(r) {
- case std::codecvt_base::ok:
- std::cout << "ok" << std::endl;
- break;
- case std::codecvt_base::partial:
- std::cout << "partial" << std::endl;
- break;
- case std::codecvt_base::error:
- std::cout << "error" << std::endl;
- break;
- default:
- std::cout << "other" << std::endl;
- break;
- }
- std::cout << "State " << std::hex << state <(&std_state);
while(to < to_end && from < from_end)
{
-#ifdef DEBUG_CODECVT
- std::cout << "Entering OUT --------------" << std::endl;
- std::cout << "State " << std::hex << state <::decode(from,from_end);
-
+
if(ch==boost::locale::utf::illegal) {
ch = BOOST_NOWIDE_REPLACEMENT_CHARACTER;
}
@@ -411,25 +355,6 @@ protected:
to_next=to;
if(r == std::codecvt_base::ok && from!=from_end)
r = std::codecvt_base::partial;
-#ifdef DEBUG_CODECVT
- std::cout << "Returning ";
- switch(r) {
- case std::codecvt_base::ok:
- std::cout << "ok" << std::endl;
- break;
- case std::codecvt_base::partial:
- std::cout << "partial" << std::endl;
- break;
- case std::codecvt_base::error:
- std::cout << "error" << std::endl;
- break;
- default:
- std::cout << "other" << std::endl;
- break;
- }
- std::cout << "State " << std::hex << state <
#else
//
-// These are function prototypes... Allow to to include windows.h
+// These are function prototypes... Allow to avoid including windows.h
//
extern "C" {
@@ -28,7 +28,7 @@ __declspec(dllimport) unsigned long __stdcall GetEnvironmentVariableW(wchar_t
}
-#endif
+#endif
diff --git a/src/iostream.cpp b/src/iostream.cpp
index c71a4e5..8c3691f 100644
--- a/src/iostream.cpp
+++ b/src/iostream.cpp
@@ -7,12 +7,21 @@
//
#define BOOST_NOWIDE_SOURCE
#include
+
+#ifndef BOOST_WINDOWS
+
+namespace boost {
+namespace nowide {
+ BOOST_NOWIDE_DECL void dummy_exported_function(){}
+}
+}
+
+#else
+
#include
#include
#include
-#ifdef BOOST_WINDOWS
-
#ifndef NOMINMAX
# define NOMINMAX
#endif
@@ -52,7 +61,7 @@ namespace details {
return -1;
int n = static_cast(pptr() - pbase());
int r = 0;
-
+
if(n > 0 && (r=write(pbase(),n)) < 0)
return -1;
if(r < n) {
@@ -65,7 +74,7 @@ namespace details {
return 0;
}
private:
-
+
int write(char const *p,int n)
{
namespace uf = boost::locale::utf;
@@ -87,33 +96,33 @@ namespace details {
return -1;
return static_cast(decoded);
}
-
+
static const int buffer_size = 1024;
char buffer_[buffer_size];
wchar_t wbuffer_[buffer_size]; // for null
HANDLE handle_;
};
-
+
class console_input_buffer: public std::streambuf {
public:
console_input_buffer(HANDLE h) :
handle_(h),
wsize_(0)
{
- }
-
+ }
+
protected:
int pbackfail(int c)
{
if(c==traits_type::eof())
return traits_type::eof();
-
+
if(gptr()!=eback()) {
gbump(-1);
*gptr() = c;
return 0;
}
-
+
if(pback_buffer_.empty()) {
pback_buffer_.resize(4);
char *b = &pback_buffer_[0];
@@ -133,7 +142,7 @@ namespace details {
*p = c;
setg(b,p,e);
}
-
+
return 0;
}
@@ -143,16 +152,16 @@ namespace details {
return -1;
if(!pback_buffer_.empty())
pback_buffer_.clear();
-
+
size_t n = read();
setg(buffer_,buffer_,buffer_+n);
if(n == 0)
return traits_type::eof();
return std::char_traits::to_int_type(*gptr());
}
-
+
private:
-
+
size_t read()
{
namespace uf = boost::locale::utf;
@@ -171,18 +180,18 @@ namespace details {
out = uf::utf_traits::encode(c,out);
wsize_ = e-p;
}
-
+
if(c==uf::illegal)
return 0;
-
-
+
+
if(c==uf::incomplete) {
std::memmove(b,e-wsize_,sizeof(wchar_t)*wsize_);
}
-
+
return out - buffer_;
}
-
+
static const size_t buffer_size = 1024 * 3;
static const size_t wbuffer_size = 1024;
char buffer_[buffer_size];
@@ -230,18 +239,18 @@ namespace details {
std::istream::rdbuf(std::cin.rdbuf());
}
}
-
+
winconsole_istream::~winconsole_istream()
{
}
-
+
} // details
-
-BOOST_NOWIDE_DECL details::winconsole_istream cin;
-BOOST_NOWIDE_DECL details::winconsole_ostream cout(1);
-BOOST_NOWIDE_DECL details::winconsole_ostream cerr(2);
-BOOST_NOWIDE_DECL details::winconsole_ostream clog(2);
-
+
+details::winconsole_istream cin;
+details::winconsole_ostream cout(1);
+details::winconsole_ostream cerr(2);
+details::winconsole_ostream clog(2);
+
namespace {
struct initialize {
initialize()
@@ -254,7 +263,7 @@ namespace {
}
-
+
} // nowide
} // namespace boost
diff --git a/standalone/config.hpp b/standalone/config.hpp
index 89c1f51..b8aca3e 100644
--- a/standalone/config.hpp
+++ b/standalone/config.hpp
@@ -25,7 +25,7 @@
# define NOWIDE_DECL __declspec(dllimport)
# endif //NOWIDE_SOURCE
# endif // DYN_LINK
-#endif
+#endif
#ifndef NOWIDE_DECL
# define NOWIDE_DECL
diff --git a/standalone/encoding_errors.hpp b/standalone/encoding_errors.hpp
index 631e410..52d219e 100644
--- a/standalone/encoding_errors.hpp
+++ b/standalone/encoding_errors.hpp
@@ -20,7 +20,7 @@
namespace nowide {
namespace conv {
///
- /// \addtogroup codepage
+ /// \addtogroup codepage
///
/// @{
diff --git a/standalone/run_convert_and_build.sh b/standalone/run_convert_and_build.sh
index 6f3dce3..75e4c66 100755
--- a/standalone/run_convert_and_build.sh
+++ b/standalone/run_convert_and_build.sh
@@ -5,7 +5,7 @@ rm -fr /tmp/nwlin /tmp/nw
pushd .
./convert && mkdir nowide/build && cd nowide/build && cmake -DCMAKE_TOOLCHAIN_FILE=../../MinGW.cmake -DCMAKE_INSTALL_PREFIX=/tmp/nw -DRUN_WITH_WINE=ON .. && make && make test && make install
-popd
+popd
pushd .
./convert && mkdir nowide/build && cd nowide/build && cmake -DLIBDIR=lin64 -DCMAKE_INSTALL_PREFIX=/tmp/nwlin .. && make && make test && make install
diff --git a/standalone/scoped_ptr.hpp b/standalone/scoped_ptr.hpp
index 1d57e78..497fa1f 100644
--- a/standalone/scoped_ptr.hpp
+++ b/standalone/scoped_ptr.hpp
@@ -2,7 +2,7 @@
#define NOWIDE_SCOPED_PTR_HPP
// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
-// Copyright (c) 2001, 2002 Peter Dimov,
+// Copyright (c) 2001, 2002 Peter Dimov,
// Copyright (C) 2012 Artyom Beilis
//
// Distributed under the Boost Software License, Version 1.0. (See
diff --git a/standalone/utf.hpp b/standalone/utf.hpp
index 783b7e6..86236ed 100644
--- a/standalone/utf.hpp
+++ b/standalone/utf.hpp
@@ -24,7 +24,7 @@ namespace utf {
namespace nowide {
///
-/// \brief Namespace that holds basic operations on UTF encoded sequences
+/// \brief Namespace that holds basic operations on UTF encoded sequences
///
/// All functions defined in this namespace do not require linking with Boost.Locale library
///
@@ -89,7 +89,7 @@ namespace utf {
/// Postconditions
///
/// - p points to the last consumed character
- ///
+ ///
template
static code_point decode(Iterator &p,Iterator e);
@@ -113,7 +113,7 @@ namespace utf {
/// Get the size of the trail part of variable length encoded sequence.
///
/// Returns -1 if C is not valid lead character
- ///
+ ///
static int trail_length(char_type c);
///
/// Returns true if c is trail code unit, always false for UTF-32
@@ -127,11 +127,11 @@ namespace utf {
///
/// Convert valid Unicode code point \a value to the UTF sequence.
///
- /// Requirements:
+ /// Requirements:
///
/// - \a value is valid code point
/// - \a out is an output iterator should be able to accept at least width(value) units
- ///
+ ///
/// Returns the iterator past the last written code unit.
///
template
@@ -144,7 +144,7 @@ namespace utf {
template
static code_point decode_valid(Iterator &p);
};
-
+
#else
template
@@ -154,8 +154,8 @@ namespace utf {
struct utf_traits {
typedef CharType char_type;
-
- static int trail_length(char_type ci)
+
+ static int trail_length(char_type ci)
{
unsigned char c = ci;
if(c < 128)
@@ -170,7 +170,7 @@ namespace utf {
return 3;
return -1;
}
-
+
static const int max_width = 4;
static int width(code_point value)
@@ -199,7 +199,7 @@ namespace utf {
{
return !is_trail(ci);
}
-
+
template
static code_point decode(Iterator &p,Iterator e)
{
@@ -220,7 +220,7 @@ namespace utf {
//
if(trail_size == 0)
return lead;
-
+
code_point c = lead & ((1<<(6-trail_size))-1);
// Read the rest
@@ -261,7 +261,7 @@ namespace utf {
return c;
}
-
+
template
static code_point decode_valid(Iterator &p)
{
@@ -277,7 +277,7 @@ namespace utf {
trail_size = 2;
else
trail_size = 3;
-
+
code_point c = lead & ((1<<(6-trail_size))-1);
switch(trail_size) {
@@ -408,7 +408,7 @@ namespace utf {
}
}; // utf16;
-
+
template
struct utf_traits {
typedef CharType char_type;
diff --git a/test/test_codecvt.cpp b/test/test_codecvt.cpp
index 3cfac58..502d85d 100644
--- a/test/test_codecvt.cpp
+++ b/test/test_codecvt.cpp
@@ -209,11 +209,11 @@ void test_codecvt_err()
TEST(to[2] == L'\uFFFD');
TEST(to[3] == L'\u05e9');
}
- }
-
+ }
+
std::cout << "- UTF-16/32" << std::endl;
{
-
+
char buf[32];
char *to=buf;
char *to_end = buf+32;
@@ -230,17 +230,17 @@ void test_codecvt_err()
TEST(to_next == to + 4);
TEST(std::memcmp(to,"1\xEF\xBF\xBD",4)==0);
}
- }
-
+ }
+
}
std::wstring codecvt_to_wide(std::string const &s)
{
std::locale l(std::locale::classic(),new boost::nowide::utf8_codecvt());
-
+
cvt_type const &cvt = std::use_facet(l);
std::vector output(s.size()+1);
-
+
std::mbstate_t mb=std::mbstate_t();
char const *from=s.c_str();
char const *from_end = from + s.size();
@@ -250,7 +250,7 @@ std::wstring codecvt_to_wide(std::string const &s)
wchar_t *to=&buf[0];
wchar_t *to_end = to + buf.size();
wchar_t *to_next = to;
-
+
TEST(cvt.in(mb,from,from_end,from_next,to,to_end,to_next)==cvt_type::ok);
std::wstring res(to,to_next);
@@ -262,10 +262,10 @@ std::wstring codecvt_to_wide(std::string const &s)
std::string codecvt_to_narrow(std::wstring const &s)
{
std::locale l(std::locale::classic(),new boost::nowide::utf8_codecvt());
-
+
cvt_type const &cvt = std::use_facet(l);
std::vector output(s.size()+1);
-
+
std::mbstate_t mb=std::mbstate_t();
wchar_t const *from=s.c_str();
wchar_t const *from_end = from + s.size();
@@ -275,7 +275,7 @@ std::string codecvt_to_narrow(std::wstring const &s)
char *to=&buf[0];
char *to_end = to + buf.size();
char *to_next = to;
-
+
TEST(cvt.out(mb,from,from_end,from_next,to,to_end,to_next)==cvt_type::ok);
std::string res(to,to_next);
@@ -291,12 +291,12 @@ void test_codecvt_subst()
}
int main()
-{
+{
try {
test_codecvt_conv();
test_codecvt_err();
test_codecvt_subst();
-
+
}
catch(std::exception const &e) {
std::cerr << "Failed : " << e.what() << std::endl;
diff --git a/test/test_fstream.cpp b/test/test_fstream.cpp
index 658944f..255bba9 100644
--- a/test/test_fstream.cpp
+++ b/test/test_fstream.cpp
@@ -14,7 +14,6 @@
#include
#include
#include
-
#include "test.hpp"
@@ -24,7 +23,7 @@ int main()
std::string example_str = prefix + "\xd7\xa9-\xd0\xbc-\xce\xbd" ".txt";
std::wstring wexample_str = boost::nowide::widen( prefix ) + L"\u05e9-\u043c-\u03bd.txt";
-
+
char const * example = example_str.c_str();
#ifdef BOOST_WINDOWS
wchar_t const * wexample = wexample_str.c_str();
@@ -32,7 +31,7 @@ int main()
try {
namespace nw=boost::nowide;
-
+
std::cout << "Testing fstream" << std::endl;
{
nw::ofstream fo;
@@ -70,7 +69,7 @@ int main()
TEST(tmp=="test");
fi.close();
}
- #if defined(BOOST_WINDOWS) || defined(BOOST_NOWIDE_FSTREAM_TESTS)
+ #if defined(BOOST_WINDOWS) || defined(BOOST_NOWIDE_FSTREAM_TESTS)
// C++11 interfaces aren't enabled at all platforms so need to skip
// for std::*fstream
{
@@ -129,16 +128,16 @@ int main()
}
nw::remove(example);
}
-
+
for(int i=-1;i<16;i++) {
std::cout << "Complex io with buffer = " << i << std::endl;
char buf[16];
nw::fstream f;
if(i==0)
f.rdbuf()->pubsetbuf(0,0);
- else if (i > 0)
+ else if (i > 0)
f.rdbuf()->pubsetbuf(buf,i);
-
+
f.open(example,nw::fstream::in | nw::fstream::out | nw::fstream::trunc | nw::fstream::binary);
f.put('a');
f.put('b');
@@ -187,7 +186,7 @@ int main()
#endif
f.close();
TEST(boost::nowide::remove(example)==0);
-
+
}
}
catch(std::exception const &e) {
diff --git a/test/test_iostream.cpp b/test/test_iostream.cpp
index 399d002..811cf3d 100644
--- a/test/test_iostream.cpp
+++ b/test/test_iostream.cpp
@@ -25,7 +25,7 @@ bool isValidUTF8(const std::string& s){
int main(int argc,char **argv)
{
-
+
char const *example = "Basic letters: \xd7\xa9-\xd0\xbc-\xce\xbd\n"
"East Asian Letters: \xe5\x92\x8c\xe5\xb9\xb3\n"
"Non-BMP letters: \xf0\x9d\x84\x9e\n"
diff --git a/test/test_sets.hpp b/test/test_sets.hpp
index a1a440b..a6b9560 100644
--- a/test/test_sets.hpp
+++ b/test/test_sets.hpp
@@ -23,7 +23,7 @@ struct wide_to_utf8 {
utf8_to_wide n2w_tests[] = {
- {
+ {
"\xf0\x9d\x92\x9e-\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82.txt",
L"\U0001D49E-\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042.txt"
},
@@ -46,7 +46,7 @@ utf8_to_wide n2w_tests[] = {
};
utf8_to_wide u2w_tests[] = {
- {
+ {
"\xf0\x9d\x92\x9e-\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82.txt",
L"\U0001D49E-\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042.txt"
},
@@ -70,23 +70,23 @@ utf8_to_wide u2w_tests[] = {
wide_to_utf8 w2n_tests_utf16[] = {
- {
+ {
L"\U0001D49E-\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042.txt",
"\xf0\x9d\x92\x9e-\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82.txt",
},
- {
+ {
L"\xD800\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xEF\xBF\xBD\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\xDC00\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\u3084\u3042\xD800\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xE3\x82\x84\xE3\x81\x82\xEF\xBF\xBD\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\u3084\u3042\xDC00\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xE3\x82\x84\xE3\x81\x82\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
}
@@ -94,23 +94,23 @@ wide_to_utf8 w2n_tests_utf16[] = {
wide_to_utf8 w2n_tests_utf32[] = {
- {
+ {
L"\U0001D49E-\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042.txt",
"\xf0\x9d\x92\x9e-\xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82.txt",
},
- {
+ {
L"\xD800\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\xDC00\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\u3084\u3042\xD800\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xE3\x82\x84\xE3\x81\x82\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
},
- {
+ {
L"\u3084\u3042\xDC00\x20\u043F\u0440\u0438\u0432\u0435\u0442-\u3084\u3042",
"\xE3\x82\x84\xE3\x81\x82\xEF\xBF\xBD \xD0\xBF\xD1\x80\xD0\xB8\xD0\xB2\xD0\xB5\xD1\x82-\xE3\x82\x84\xE3\x81\x82"
}
diff --git a/test/test_system.cpp b/test/test_system.cpp
index e5bdcf5..2287079 100644
--- a/test/test_system.cpp
+++ b/test/test_system.cpp
@@ -44,7 +44,7 @@ int main(int argc,char **argv,char **env)
}
else if(argc==2 && argv[1][0]=='-') {
switch(argv[1][1]) {
- case 'w':
+ case 'w':
{
#ifdef BOOST_WINDOWS
std::wstring env = L"BOOST_NOWIDE_TEST=" + wexample;