mirror of
https://github.com/boostorg/serialization.git
synced 2026-01-19 04:42:10 +00:00
tabs and licence
[SVN r23760]
This commit is contained in:
BIN
borland6ide/Attic/test_simple_class.res
Normal file
BIN
borland6ide/Attic/test_simple_class.res
Normal file
Binary file not shown.
BIN
borland6ide/test_simple_class.res
Normal file
BIN
borland6ide/test_simple_class.res
Normal file
Binary file not shown.
BIN
borland6ide/test_simple_class.tds
Normal file
BIN
borland6ide/test_simple_class.tds
Normal file
Binary file not shown.
@@ -45,12 +45,13 @@ WSOURCES =
|
||||
utf8_codecvt_facet
|
||||
;
|
||||
|
||||
lib boost_serialization
|
||||
lib boost_serialization
|
||||
: ## sources ##
|
||||
../src/$(SOURCES).cpp
|
||||
: ## requirements ##
|
||||
std::locale-support
|
||||
<msvc><*><include>$(SPIRIT_ROOT)
|
||||
<msvc-stlport><*><include>$(SPIRIT_ROOT)
|
||||
<vc7><*><include>$(SPIRIT_ROOT)
|
||||
<borland><*><include>$(SPIRIT_ROOT)
|
||||
<borland-5.5.1><*><include>$(SPIRIT_ROOT)
|
||||
@@ -65,12 +66,13 @@ lib boost_serialization
|
||||
<runtime-link>static <threading>single/multi
|
||||
;
|
||||
|
||||
lib boost_wserialization
|
||||
lib boost_wserialization
|
||||
: ## sources ##
|
||||
../src/$(WSOURCES).cpp
|
||||
: ## requirements ##
|
||||
std::locale-support
|
||||
<msvc><*><include>$(SPIRIT_ROOT)
|
||||
<msvc-stlport><*><include>$(SPIRIT_ROOT)
|
||||
<vc7><*><include>$(SPIRIT_ROOT)
|
||||
<borland><*><include>$(SPIRIT_ROOT)
|
||||
<borland-5.5.1><*><include>$(SPIRIT_ROOT)
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
# Boost serialization Library Build Jamfile
|
||||
# (C) Copyright Robert Ramey 2002-2004.
|
||||
# Use, modification, and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# See http://www.boost.org/libs/serialization for the library home page.
|
||||
|
||||
project boost/serialization
|
||||
: source-location ../src
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -27,14 +33,14 @@
|
||||
(still pending at the writing) regarding this.
|
||||
<li>Pavel Vozenilek invested much effort in review of code and documentation
|
||||
resulting in many improvements.
|
||||
<li><a href="../../people/jens_maurer.htm">Jens Maurer</a> and
|
||||
<a href="../../people/beman_dawes.html">Beman Dawes</a> who got the boost
|
||||
<li><a href="../../../people/jens_maurer.htm">Jens Maurer</a> and
|
||||
<a href="../../../people/beman_dawes.html">Beman Dawes</a> who got the boost
|
||||
serialization ball rolling. It was one or both of these two that invented
|
||||
the much beloved <code>&</code> syntax used to implement both save and
|
||||
load in one fuction specification.
|
||||
<li><a href="mailto:ghost@cs.msu.su">Vladimir Prus</a> for evaluating an
|
||||
<li><a href="../../../people/vladimir_prus.htm">Vladimir Prus</a> for evaluating an
|
||||
early draft and contributing the diamond inheritance example.
|
||||
<li><a href="../../people/william_kempf.htm">William E. Kempf</a>
|
||||
<li><a href="../../../people/william_kempf.htm">William E. Kempf</a>
|
||||
who made the templates for this and other boost manuals. This relieved
|
||||
me of much aggravation.
|
||||
<li><a href="mailto:vahan@unicad.am">Vahan Margaryan</a> and
|
||||
@@ -45,7 +51,8 @@
|
||||
tangible changes in the library which made it much better.
|
||||
<li>boosters who helped out in porting to other platforms:Pavel Vozenilek
|
||||
(Borland, VC 6.0, Intel), Fernando Cacciola (Borland), Jeff Flinn (VC 7.1),
|
||||
Vladimir Prus (gcc 3.3) among others.
|
||||
Vladimir Prus (gcc 3.3), Christoph Ludwig(gcc 3.4), Rene Rivera (CW)
|
||||
and Marshall Clow(gcc-Darwin) among others.
|
||||
<li>all boost members who participated in the first formal review
|
||||
in November 2002. Many of these members invested quite an effort
|
||||
to evaluate the library and suggest changes. They are
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -49,7 +55,7 @@ accomplished through the use of a member template or explict declarations
|
||||
for all prmititive types.
|
||||
</dd>
|
||||
|
||||
<dt><h4><code>void load_binary(void *address, size_t size);</code></h4></dt>
|
||||
<dt><h4><code>void load_binary(void *address, std::size_t size);</code></h4></dt>
|
||||
<dd>
|
||||
This function should <code style="white-space: normal">size</code> bytes from the archive, and
|
||||
copy them in to memory starting at address <code style="white-space: normal">address</code>.
|
||||
@@ -91,7 +97,7 @@ public:
|
||||
// serialization library
|
||||
|
||||
// archives are expected to support this function
|
||||
void load_binary(void *address, size_t count);
|
||||
void load_binary(void *address, std::size_t count);
|
||||
};
|
||||
|
||||
</code></pre>
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
return *this << t;
|
||||
}
|
||||
|
||||
void save_binary(const void *address, size_t count);
|
||||
void save_binary(const void *address, std::size_t count);
|
||||
|
||||
template<class T>
|
||||
register_type(T * t = NULL);
|
||||
@@ -148,7 +148,7 @@ Appends an object of type T to the archive. The object may be
|
||||
</dd>
|
||||
|
||||
<dt><h4><code>
|
||||
void save_binary(const void *address, size_t count);
|
||||
void save_binary(const void *address, std::size_t count);
|
||||
</code></h4></dt>
|
||||
<dd>
|
||||
Appends to the archive <code style="white-space: normal">count</code> bytes found at
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
|
||||
void delete_created_pointers();
|
||||
|
||||
void load_binary(void *address, size_t count);
|
||||
void load_binary(void *address, std::size_t count);
|
||||
|
||||
template<class T>
|
||||
register_type(T * t = NULL);
|
||||
@@ -301,7 +301,7 @@ Retrieves an object of type T from the archive. The object may be
|
||||
</dd>
|
||||
|
||||
<dt><h4><code>
|
||||
void load_binary(void *address, size_t count);
|
||||
void load_binary(void *address, std::size_t count);
|
||||
</code></h4></dt>
|
||||
<dd>
|
||||
Retrieves from the archive <code style="white-space: normal">count</code> bytes and stores
|
||||
@@ -388,7 +388,7 @@ for all archives. Archive classes have other members not mentioned here.
|
||||
However they are related to the internal functioning of the library and
|
||||
are not meant to be called by users of an archive. Implementation of new
|
||||
archives is discussed in
|
||||
<a href="newarchive#implementation">New Archives - Implementation</a>.
|
||||
<a href="archive_reference.html#implementation">New Archives - Implementation</a>.
|
||||
|
||||
<p>
|
||||
The existence of the <code style="white-space: normal"><<</code>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
|
||||
"http://www.w3.org/TR/html4/frameset.dtd"><html>
|
||||
<head>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../boost.css">
|
||||
<title>Serialization</title>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -467,12 +473,14 @@ can be found in the example
|
||||
<a href="../../../boost/serialization/shared_ptr.hpp" target="shared_ptr_hpp">
|
||||
shared_ptr.hpp
|
||||
</a>
|
||||
<!--
|
||||
Only the most minimal change to
|
||||
<a href="../../../boost/serialization/shared_count.hpp" target="shared_count_hpp">
|
||||
shared_count.hpp</a>
|
||||
(to gain access to some private members) was necessary to achieve this.
|
||||
This should demonstrate how easy it is to non-intrusively
|
||||
implement serialization to any data type or template.
|
||||
-->
|
||||
<p>
|
||||
In the specification of serialization for templates, its common
|
||||
to split <code style="white-space: normal">serialize</code>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -230,11 +236,6 @@ and we don't have to include a trival serializer for <code style="white-space: n
|
||||
Finally we need to specify name-value pair wrappers if we want to be able
|
||||
to use this serialization with XML archives.
|
||||
<p>
|
||||
All of the above considerations are addressed in
|
||||
<a href="../../../boost/serialization/shared_ptr.hpp" target="shared_ptr_hpp">
|
||||
shared_ptr.hpp
|
||||
</a>
|
||||
<p>
|
||||
Actually, even this is really just a start. Among the issues not addressed in
|
||||
this implementation are:
|
||||
<ul>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -60,7 +66,7 @@ void func(A & a)
|
||||
|
||||
<h3>History</h3>
|
||||
This is a generalization if Daryle Walker's
|
||||
<a href="../../../libs?io/doc/ios_state.html">io_state_saver</a> library.
|
||||
<a href="../../../libs/io/doc/ios_state.html">io_state_saver</a> library.
|
||||
<p>
|
||||
Robert Ramey made an initial version for the serialization library.
|
||||
<p>
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
<!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" type="text/css" href="../../../boost.css">
|
||||
@@ -128,7 +134,7 @@ Included is
|
||||
which renders it's data members as <strong>name-value-pair</strong>s and
|
||||
<a href="../example/demo_xml.cpp" target="demo_xml_cpp">demo_xml.cpp<a>
|
||||
which saves and loads data to an XML archive.
|
||||
<a href="../example/demofile.xml" target="demofile_xml">Here</a>
|
||||
<a href="../example/demo_save.xml" target="demo_save_xml">Here</a>
|
||||
is example of the XML Archive corresponding to our tutorial example.
|
||||
|
||||
<h3><a name="composition">Composition</h3>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
# Boost serialization Library test Jamfile
|
||||
# Boost serialization Library Build Jamfile
|
||||
# (C) Copyright Robert Ramey 2002-2004.
|
||||
# Use, modification, and distribution are subject to the
|
||||
# Boost Software License, Version 1.0. (See accompanying file
|
||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
#
|
||||
# See http://www.boost.org/libs/serialization for the library home page.
|
||||
|
||||
subproject libs/serialization/example ;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// demo.cpp : demonstrates usage of serialization system
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo.cpp
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
@@ -296,9 +297,6 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demofile.txt";
|
||||
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
@@ -351,6 +349,9 @@ int main(int argc, char *argv[])
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demofile.txt";
|
||||
|
||||
// save the schedule
|
||||
save_schedule(original_schedule, filename.c_str());
|
||||
|
||||
|
||||
@@ -1,24 +1,28 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_auto_ptr.cpp
|
||||
|
||||
// demo_auto_ptr.cpp : demonstrates adding serialization to a template
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/config.hpp> // std::autoptr inteface wrong in dinkumware
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <cstdio> // remove, std::autoptr inteface wrong in dinkumware
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/tmpdir.hpp>
|
||||
|
||||
#include <boost/archive/text_oarchive.hpp>
|
||||
#include <boost/archive/text_iarchive.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#include <boost/serialization/split_free.hpp>
|
||||
|
||||
@@ -106,8 +110,8 @@ void load(std::auto_ptr<A> &spa, const char *filename)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename = boost::archive::tmpdir();
|
||||
filename += "/testfile";
|
||||
std::string filename = boost::archive::tmpdir();
|
||||
filename += "/testfile";
|
||||
|
||||
// create a new auto pointer to ta new object of type A
|
||||
std::auto_ptr<A> spa(new A);
|
||||
@@ -126,6 +130,6 @@ int main(int argc, char *argv[])
|
||||
load(spa, filename.c_str());
|
||||
// obj of type A gets destroyed
|
||||
// as auto_ptr goes out of scope
|
||||
std::remove(filename.c_str());
|
||||
std::remove(filename.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_exception.cpp
|
||||
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// Example of safe exception handling for pointer de-serialization
|
||||
//
|
||||
// This example was prepared by Robert Ramey to demonstrate and test
|
||||
@@ -9,17 +17,25 @@
|
||||
// in the analysis and testing of issues of exception safety
|
||||
// of the serialization library.
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/tmpdir.hpp>
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/list.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
|
||||
@@ -216,10 +232,10 @@ void load(School * & school, const char *filename){
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demofile.txt";
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demofile.txt";
|
||||
|
||||
School *school = new School();
|
||||
School *school = new School();
|
||||
std::cout << "1. student count = " << Student::count << std::endl;
|
||||
std::cout << "2. class count = " << Course::count << std::endl;
|
||||
init(school);
|
||||
@@ -236,6 +252,6 @@ int main(int argc, char *argv[]){
|
||||
delete school;
|
||||
std::cout << "9. student count = " << Student::count << std::endl;
|
||||
std::cout << "10. class count = " << Course::count << std::endl;
|
||||
std::remove(filename.c_str());
|
||||
std::remove(filename.c_str());
|
||||
return Student::count + Course::count;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class fast_binary_oarchive :
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class boost::archive::detail::interface_oarchive<derived_t>;
|
||||
friend class boost::archive::detail::interface_oarchive<derived_t>;
|
||||
friend class basic_binary_oarchive<derived_t>;
|
||||
friend class basic_binary_oprimitive<derived_t, std::ostream>;
|
||||
friend class boost::archive::save_access;
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
// add base class to the places considered when matching
|
||||
// save function to a specific set of arguments. Note, this didn't
|
||||
// work on my MSVC 7.0 system
|
||||
// using binary_oarchive_impl<derived_t>::load_override;
|
||||
// using binary_oarchive_impl<derived_t>::load_override;
|
||||
// so we use the sure-fire method below. This failed to work as well
|
||||
template<class T>
|
||||
void save_override(const T & t, BOOST_PFTO int){
|
||||
@@ -85,7 +85,7 @@ class fast_binary_iarchive :
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class boost::archive::detail::interface_iarchive<derived_t>;
|
||||
friend class boost::archive::detail::interface_iarchive<derived_t>;
|
||||
friend class basic_binary_iarchive<derived_t>;
|
||||
friend class basic_binary_iprimitive<derived_t, std::istream>;
|
||||
friend class boost::archive::load_access;
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
// add base class to the places considered when matching
|
||||
// save function to a specific set of arguments. Note, this didn't
|
||||
// work on my MSVC 7.0 system
|
||||
// using binary_oarchive_impl<derived_t>::load_override;
|
||||
// using binary_oarchive_impl<derived_t>::load_override;
|
||||
// so we use the sure-fire method below. This failed to work as well
|
||||
template<class T>
|
||||
void load_override(T & t, BOOST_PFTO int){
|
||||
|
||||
@@ -21,44 +21,44 @@
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
A a, a1;
|
||||
{
|
||||
// test with a text archive
|
||||
std::stringstream ss;
|
||||
{
|
||||
// instantiate archive which inhertis polymorphic interface
|
||||
// and the normal text archive implementation
|
||||
boost::archive::polymorphic_text_oarchive oa(ss);
|
||||
boost::archive::polymorphic_oarchive & oa_interface = oa;
|
||||
// we can just just the interface for saving
|
||||
oa_interface << a;
|
||||
}
|
||||
{
|
||||
// or we can use the implementation directly
|
||||
boost::archive::polymorphic_text_iarchive ia(ss);
|
||||
ia >> a1;
|
||||
}
|
||||
}
|
||||
if(! (a == a1))
|
||||
return 1;
|
||||
{
|
||||
//test with a binary archive
|
||||
std::stringstream ss;
|
||||
{
|
||||
// instantiate archive which inhertis polymorphic interface
|
||||
// and the normal binary archive implementation
|
||||
boost::archive::polymorphic_binary_oarchive oa(ss);
|
||||
oa << a;
|
||||
}
|
||||
{
|
||||
// see above
|
||||
boost::archive::polymorphic_binary_iarchive ia(ss);
|
||||
boost::archive::polymorphic_iarchive & ia_interface = ia;
|
||||
// use just the polymorphic interface for loading.
|
||||
ia_interface >> a1;
|
||||
}
|
||||
}
|
||||
if(! (a == a1))
|
||||
return 1;
|
||||
return 0;
|
||||
{
|
||||
// test with a text archive
|
||||
std::stringstream ss;
|
||||
{
|
||||
// instantiate archive which inhertis polymorphic interface
|
||||
// and the normal text archive implementation
|
||||
boost::archive::polymorphic_text_oarchive oa(ss);
|
||||
boost::archive::polymorphic_oarchive & oa_interface = oa;
|
||||
// we can just just the interface for saving
|
||||
oa_interface << a;
|
||||
}
|
||||
{
|
||||
// or we can use the implementation directly
|
||||
boost::archive::polymorphic_text_iarchive ia(ss);
|
||||
ia >> a1;
|
||||
}
|
||||
}
|
||||
if(! (a == a1))
|
||||
return 1;
|
||||
{
|
||||
//test with a binary archive
|
||||
std::stringstream ss;
|
||||
{
|
||||
// instantiate archive which inhertis polymorphic interface
|
||||
// and the normal binary archive implementation
|
||||
boost::archive::polymorphic_binary_oarchive oa(ss);
|
||||
oa << a;
|
||||
}
|
||||
{
|
||||
// see above
|
||||
boost::archive::polymorphic_binary_iarchive ia(ss);
|
||||
boost::archive::polymorphic_iarchive & ia_interface = ia;
|
||||
// use just the polymorphic interface for loading.
|
||||
ia_interface >> a1;
|
||||
}
|
||||
}
|
||||
if(! (a == a1))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,12 +20,12 @@ class polymorphic_oarchive;
|
||||
|
||||
struct A {
|
||||
// class a contains a pointer to a "hidden" declaration
|
||||
void serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int file_version);
|
||||
void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version);
|
||||
int data;
|
||||
bool operator==(const A & rhs) const {
|
||||
return data == rhs.data;
|
||||
}
|
||||
void serialize(boost::archive::polymorphic_iarchive & ar, const unsigned int file_version);
|
||||
void serialize(boost::archive::polymorphic_oarchive & ar, const unsigned int file_version);
|
||||
int data;
|
||||
bool operator==(const A & rhs) const {
|
||||
return data == rhs.data;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // BOOST_SERIALIZATION_EXAMPLE_DEMO_POLYMORPHIC_A_HPP
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
//
|
||||
// demo_portable_binary_archive.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
@@ -35,11 +36,11 @@ class A
|
||||
public:
|
||||
bool operator==(A & rhs){
|
||||
return
|
||||
i == rhs.i && ui == rhs.ui && l == rhs.l && ul == rhs.ul
|
||||
i == rhs.i && ui == rhs.ui && l == rhs.l && ul == rhs.ul
|
||||
;
|
||||
}
|
||||
A() :
|
||||
i(std::rand()),
|
||||
i(std::rand()),
|
||||
ui(std::rand()),
|
||||
l(std::rand()),
|
||||
ul(std::rand())
|
||||
|
||||
@@ -14,8 +14,16 @@
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/tmpdir.hpp>
|
||||
#include <boost/serialization/shared_ptr.hpp>
|
||||
|
||||
#include <boost/archive/text_oarchive.hpp>
|
||||
#include <boost/archive/text_iarchive.hpp>
|
||||
@@ -71,8 +79,8 @@ void display(boost::shared_ptr<A> &spa, boost::shared_ptr<A> &spa1)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/testfile";
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/testfile";
|
||||
|
||||
// create a new shared pointer to ta new object of type A
|
||||
boost::shared_ptr<A> spa(new A);
|
||||
@@ -122,11 +130,11 @@ int main(int argc, char *argv[])
|
||||
boost::archive::text_oarchive oa(ofs);
|
||||
oa.register_type(static_cast<B *>(NULL));
|
||||
oa.register_type(
|
||||
static_cast<
|
||||
boost::detail::sp_counted_base_impl<
|
||||
B *, boost::checked_deleter<B>
|
||||
> *
|
||||
>(NULL)
|
||||
static_cast<
|
||||
boost::detail::sp_counted_base_impl<
|
||||
B *, boost::checked_deleter<B>
|
||||
> *
|
||||
>(NULL)
|
||||
);
|
||||
oa << spa;
|
||||
oa << spa1;
|
||||
@@ -146,18 +154,18 @@ int main(int argc, char *argv[])
|
||||
// restore the schedule from the archive
|
||||
ia.register_type(static_cast<B *>(NULL));
|
||||
ia.register_type(
|
||||
static_cast<
|
||||
boost::detail::sp_counted_base_impl<
|
||||
B *, boost::checked_deleter<B>
|
||||
> *
|
||||
>(NULL)
|
||||
static_cast<
|
||||
boost::detail::sp_counted_base_impl<
|
||||
B *, boost::checked_deleter<B>
|
||||
> *
|
||||
>(NULL)
|
||||
);
|
||||
ia >> spa;
|
||||
ia >> spa1;
|
||||
}
|
||||
display(spa, spa1);
|
||||
///////////////
|
||||
std::remove(filename.c_str());
|
||||
std::remove(filename.c_str());
|
||||
|
||||
// obj of type A gets destroyed
|
||||
// as smart_ptr goes out of scope
|
||||
|
||||
@@ -1,16 +1,25 @@
|
||||
// demo_xml.cpp : demonstrates usage of serialization system
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
//
|
||||
// demo_xml.cpp
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/tmpdir.hpp>
|
||||
#include <boost/archive/xml_iarchive.hpp>
|
||||
#include <boost/archive/xml_oarchive.hpp>
|
||||
@@ -39,10 +48,10 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo.xml";
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo.xml";
|
||||
|
||||
// make the schedule
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
// fill in the data
|
||||
@@ -94,6 +103,9 @@ int main(int argc, char *argv[])
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo.xml";
|
||||
|
||||
// save the schedule
|
||||
save_schedule(original_schedule, filename.c_str());
|
||||
|
||||
@@ -108,7 +120,7 @@ int main(int argc, char *argv[])
|
||||
std::cout << new_schedule;
|
||||
// should be the same as the old one. (except for the pointer values)
|
||||
|
||||
std::remove(filename.c_str());
|
||||
std::remove(filename.c_str());
|
||||
|
||||
delete bs0;
|
||||
delete bs1;
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#define BOOST_SERIALIZATION_EXAMPLE_DEMO_XML_HPP
|
||||
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_xml.hpp : demonstrates usage of serialization system
|
||||
//
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . Permission to copy, use, modify,
|
||||
// sell and distribute this software is granted provided this copyright notice appears
|
||||
// in all copies. This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
// demo_xml.hpp
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <iomanip>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_xml_load.cpp : demonstrates usage of serialization system
|
||||
//
|
||||
// demo_xml_load.cpp
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -29,12 +29,12 @@ restore_schedule(bus_schedule &s, const char * filename)
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
|
||||
// make a new schedule
|
||||
// make a new schedule
|
||||
bus_schedule new_schedule;
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
|
||||
restore_schedule(new_schedule, filename.c_str());
|
||||
|
||||
// and display
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// demo_xml_save.hpp : demonstrates usage of serialization system
|
||||
//
|
||||
// demo_xml_save.cpp
|
||||
//
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -25,10 +25,10 @@ void save_schedule(const bus_schedule &s, const char * filename){
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
|
||||
// make the schedule
|
||||
// make the schedule
|
||||
bus_schedule original_schedule;
|
||||
|
||||
// fill in the data
|
||||
@@ -80,6 +80,9 @@ int main(int argc, char *argv[])
|
||||
std::cout << "original schedule";
|
||||
std::cout << original_schedule;
|
||||
|
||||
std::string filename(boost::archive::tmpdir());
|
||||
filename += "/demo_save.xml";
|
||||
|
||||
// save the schedule
|
||||
save_schedule(original_schedule, filename.c_str());
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// exception to be thrown if integer read from archive doesn't fit
|
||||
// variable being loaded
|
||||
class portable_binary_archive_exception :
|
||||
public virtual boost::archive::archive_exception
|
||||
public virtual boost::archive::archive_exception
|
||||
{
|
||||
public:
|
||||
typedef enum {
|
||||
@@ -38,7 +38,7 @@ public:
|
||||
case incompatible_integer_size:
|
||||
msg = "integer cannot be represented";
|
||||
default:
|
||||
boost::archive::archive_exception::what();
|
||||
boost::archive::archive_exception::what();
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
@@ -50,32 +50,32 @@ public:
|
||||
// be passed across systems. Note:floating point types not addressed here
|
||||
class portable_binary_iarchive :
|
||||
// don't derive from binary_oarchive !!!
|
||||
public boost::archive::binary_iarchive_impl<portable_binary_iarchive>
|
||||
public boost::archive::binary_iarchive_impl<portable_binary_iarchive>
|
||||
{
|
||||
typedef portable_binary_iarchive derived_t;
|
||||
typedef portable_binary_iarchive derived_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
public:
|
||||
#else
|
||||
friend class boost::archive::basic_binary_iarchive<derived_t>;
|
||||
friend class boost::archive::basic_binary_iprimitive<derived_t, std::istream>;
|
||||
friend class boost::archive::load_access;
|
||||
friend class boost::archive::load_access;
|
||||
#endif
|
||||
void load_impl(long & l, char maxsize){
|
||||
char size;
|
||||
size = is.get();
|
||||
if(size > maxsize)
|
||||
throw portable_binary_archive_exception() ;
|
||||
l = 0;
|
||||
load_binary(& l, size);
|
||||
// we choose to use litle endian
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
char * first = static_cast<char *>(static_cast<void *>(& l));
|
||||
char * last = first + sizeof(l) - 1;
|
||||
for(;first < last;++first, --last){
|
||||
char x = *first;
|
||||
*last = *first;
|
||||
*first = x;
|
||||
}
|
||||
throw portable_binary_archive_exception() ;
|
||||
l = 0;
|
||||
load_binary(& l, size);
|
||||
// we choose to use litle endian
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
char * first = static_cast<char *>(static_cast<void *>(& l));
|
||||
char * last = first + sizeof(l) - 1;
|
||||
for(;first < last;++first, --last){
|
||||
char x = *first;
|
||||
*last = *first;
|
||||
*first = x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// default fall through for any types not specified here
|
||||
@@ -106,15 +106,15 @@ public:
|
||||
public:
|
||||
portable_binary_iarchive(std::istream & is, unsigned flags = 0) :
|
||||
boost::archive::binary_iarchive_impl<derived_t>(
|
||||
is,
|
||||
flags | boost::archive::no_header // skip default header checking
|
||||
is,
|
||||
flags | boost::archive::no_header // skip default header checking
|
||||
)
|
||||
{
|
||||
// use our own header checking
|
||||
if(0 != (flags & boost::archive::no_header)){
|
||||
boost::archive::basic_binary_iarchive<derived_t>::init();
|
||||
// skip the following for "portable" binary archives
|
||||
// boost::archive::basic_binary_oprimitive<derived_t, std::ostream>::init();
|
||||
boost::archive::basic_binary_iarchive<derived_t>::init();
|
||||
// skip the following for "portable" binary archives
|
||||
// boost::archive::basic_binary_oprimitive<derived_t, std::ostream>::init();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
class portable_binary_oarchive :
|
||||
// don't derive from binary_oarchive !!!
|
||||
public boost::archive::binary_oarchive_impl<portable_binary_oarchive>
|
||||
public boost::archive::binary_oarchive_impl<portable_binary_oarchive>
|
||||
{
|
||||
typedef portable_binary_oarchive derived_t;
|
||||
#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
@@ -41,21 +41,21 @@ public:
|
||||
long ll = l;
|
||||
char size = 0;;
|
||||
do{
|
||||
ll >>= 8;
|
||||
++size;
|
||||
ll >>= 8;
|
||||
++size;
|
||||
}while(ll != -1 && ll != 0);
|
||||
|
||||
os.put(size);
|
||||
|
||||
// we choose to use litle endian
|
||||
// we choose to use litle endian
|
||||
#ifdef BOOST_BIG_ENDIAN
|
||||
char * first = static_cast<char *>(static_cast<void *>(& l));
|
||||
char * last = first + size - 1;
|
||||
for(;first < last;++first, --last){
|
||||
char x = *first;
|
||||
*last = *first;
|
||||
*first = x;
|
||||
}
|
||||
char * first = static_cast<char *>(static_cast<void *>(& l));
|
||||
char * last = first + size - 1;
|
||||
for(;first < last;++first, --last){
|
||||
char x = *first;
|
||||
*last = *first;
|
||||
*first = x;
|
||||
}
|
||||
#endif
|
||||
save_binary(& l, size);
|
||||
}
|
||||
@@ -84,15 +84,15 @@ public:
|
||||
public:
|
||||
portable_binary_oarchive(std::ostream & os, unsigned flags = 0) :
|
||||
boost::archive::binary_oarchive_impl<derived_t>(
|
||||
os,
|
||||
flags | boost::archive::no_header // skip default header checking
|
||||
os,
|
||||
flags | boost::archive::no_header // skip default header checking
|
||||
)
|
||||
{
|
||||
// use our own header checking
|
||||
if(0 != (flags & boost::archive::no_header)){
|
||||
boost::archive::basic_binary_oarchive<derived_t>::init();
|
||||
// skip the following for "portable" binary archives
|
||||
// boost::archive::basic_binary_iprimitive<derived_t, std::ostream>::init();
|
||||
boost::archive::basic_binary_oarchive<derived_t>::init();
|
||||
// skip the following for "portable" binary archives
|
||||
// boost::archive::basic_binary_iprimitive<derived_t, std::ostream>::init();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<html>
|
||||
<!--
|
||||
(C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
Use, modification and distribution is subject to the Boost Software
|
||||
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
http://www.boost.org/LICENSE_1_0.txt)
|
||||
-->
|
||||
<head>
|
||||
<meta http-equiv="refresh" content="0; URL=doc/index.html">
|
||||
</head>
|
||||
|
||||
@@ -176,11 +176,11 @@ class basic_iarchive_impl
|
||||
const basic_iserializer & bis
|
||||
);
|
||||
|
||||
// redirect through virtual functions to load functions for this archive
|
||||
template<class T>
|
||||
void load(basic_iarchive & ar, T & t){
|
||||
ar.vload(t);
|
||||
}
|
||||
// redirect through virtual functions to load functions for this archive
|
||||
template<class T>
|
||||
void load(basic_iarchive & ar, T & t){
|
||||
ar.vload(t);
|
||||
}
|
||||
|
||||
public:
|
||||
void delete_created_pointers();
|
||||
@@ -197,7 +197,7 @@ public:
|
||||
void * & t,
|
||||
const basic_pointer_iserializer * bpis,
|
||||
const basic_pointer_iserializer * (*finder)(
|
||||
const boost::serialization::extended_type_info & type
|
||||
const boost::serialization::extended_type_info & type
|
||||
)
|
||||
);
|
||||
};
|
||||
@@ -209,7 +209,7 @@ basic_iarchive_impl::delete_created_pointers()
|
||||
const created_pointer_type & cp = created_pointers.front();
|
||||
|
||||
// figure out the class of the object to be deleted
|
||||
// note: extra line used to evand borland issue
|
||||
// note: extra line used to evade borland issue
|
||||
const int id = cp.class_id;
|
||||
const cobject_id & co = cobject_id_vector[id];
|
||||
// with the appropriate input serializer,
|
||||
@@ -251,7 +251,7 @@ basic_iarchive_impl::load_preamble(
|
||||
}
|
||||
else{
|
||||
// override tracking with indicator from class information
|
||||
co.tracking_level = co.bis_ptr->tracking();
|
||||
co.tracking_level = co.bis_ptr->tracking();
|
||||
co.file_version = version_type(
|
||||
co.bis_ptr->version()
|
||||
);
|
||||
@@ -329,7 +329,7 @@ basic_iarchive_impl::load_pointer(
|
||||
if(NULL == bpis_ptr
|
||||
// or polymorphic
|
||||
|| bpis_ptr->get_basic_serializer().is_polymorphic()){
|
||||
// is must have been exported
|
||||
// is must have been exported
|
||||
char key[BOOST_SERIALIZATION_MAX_KEY_SIZE];
|
||||
class_name_type class_name(key);
|
||||
load(ar, class_name);
|
||||
@@ -345,11 +345,11 @@ basic_iarchive_impl::load_pointer(
|
||||
}
|
||||
assert(NULL != bpis_ptr);
|
||||
class_id_type new_cid = register_type(bpis_ptr->get_basic_serializer());
|
||||
int i = cid;
|
||||
int i = cid;
|
||||
cobject_id_vector[i].bpis_ptr = bpis_ptr;
|
||||
assert(new_cid == cid);
|
||||
}
|
||||
int i = cid;
|
||||
int i = cid;
|
||||
cobject_id & co = cobject_id_vector[i];
|
||||
const basic_iserializer * bis_ptr = co.bis_ptr;
|
||||
bpis_ptr = co.bpis_ptr;
|
||||
@@ -368,25 +368,25 @@ basic_iarchive_impl::load_pointer(
|
||||
state_saver<bool> x(is_object);
|
||||
is_object = false;
|
||||
|
||||
if(bis_ptr->tracking()){
|
||||
// predict next object id to be created
|
||||
const unsigned int i = object_id_vector.size();
|
||||
if(bis_ptr->tracking()){
|
||||
// predict next object id to be created
|
||||
const unsigned int i = object_id_vector.size();
|
||||
|
||||
// because the following operation could move the items
|
||||
// don't use co after this
|
||||
object_id_vector.push_back(aobject(t, cid));
|
||||
bpis_ptr->load_object_ptr(
|
||||
ar,
|
||||
object_id_vector[i].address,
|
||||
co.file_version
|
||||
);
|
||||
t = object_id_vector[i].address;
|
||||
// because the following operation could move the items
|
||||
// don't use co after this
|
||||
object_id_vector.push_back(aobject(t, cid));
|
||||
bpis_ptr->load_object_ptr(
|
||||
ar,
|
||||
object_id_vector[i].address,
|
||||
co.file_version
|
||||
);
|
||||
t = object_id_vector[i].address;
|
||||
// and add to list of created pointers
|
||||
created_pointers.push_back(created_pointer_type(cid, t));
|
||||
}
|
||||
else{
|
||||
bpis_ptr->load_object_ptr(ar, t, co.file_version);
|
||||
}
|
||||
}
|
||||
else{
|
||||
bpis_ptr->load_object_ptr(ar, t, co.file_version);
|
||||
}
|
||||
assert(NULL != t);
|
||||
}
|
||||
|
||||
@@ -403,7 +403,7 @@ basic_iarchive::basic_iarchive() :
|
||||
|
||||
basic_iarchive::~basic_iarchive()
|
||||
{
|
||||
delete pimpl;
|
||||
delete pimpl;
|
||||
}
|
||||
|
||||
void basic_iarchive::load_object(
|
||||
|
||||
@@ -328,14 +328,14 @@ basic_oarchive_impl::save_pointer(
|
||||
const char * key = NULL;
|
||||
if(NULL != eti)
|
||||
key = eti->key;
|
||||
if(NULL != key){
|
||||
// the following is required by IBM C++ compiler which
|
||||
// makes a copy when passing a non-const to a const. This
|
||||
// is permitted by the standard but rarely seen in practice
|
||||
const class_name_type cn(key);
|
||||
if(NULL != key){
|
||||
// the following is required by IBM C++ compiler which
|
||||
// makes a copy when passing a non-const to a const. This
|
||||
// is permitted by the standard but rarely seen in practice
|
||||
const class_name_type cn(key);
|
||||
// write out the external class identifier
|
||||
ar.vsave(cn);
|
||||
}
|
||||
}
|
||||
else
|
||||
// without an external class name
|
||||
// we won't be able to de-serialize it so bail now
|
||||
@@ -374,7 +374,7 @@ basic_oarchive::basic_oarchive()
|
||||
|
||||
basic_oarchive::~basic_oarchive()
|
||||
{
|
||||
delete pimpl;
|
||||
delete pimpl;
|
||||
}
|
||||
|
||||
void basic_oarchive::save_object(
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
#include <boost/archive/detail/basic_serializer_map.hpp>
|
||||
|
||||
namespace boost {
|
||||
namespace serialization {
|
||||
class extended_type_info;
|
||||
}
|
||||
namespace serialization {
|
||||
class extended_type_info;
|
||||
}
|
||||
namespace archive {
|
||||
namespace detail {
|
||||
|
||||
@@ -30,9 +30,9 @@ bool basic_serializer_map::insert(const basic_serializer * bs){
|
||||
|
||||
class basic_serializer_arg : public basic_serializer {
|
||||
public:
|
||||
basic_serializer_arg(const serialization::extended_type_info & eti) :
|
||||
basic_serializer(eti)
|
||||
{}
|
||||
basic_serializer_arg(const serialization::extended_type_info & eti) :
|
||||
basic_serializer(eti)
|
||||
{}
|
||||
};
|
||||
|
||||
const basic_serializer * basic_serializer_map::tfind(
|
||||
|
||||
@@ -147,7 +147,7 @@ bool basic_xml_grammar<CharType>::my_parse(
|
||||
BOOST_DEDUCED_TYPENAME basic_xml_grammar<CharType>::IStream & is,
|
||||
const rule_t & rule_,
|
||||
CharType delimiter
|
||||
){
|
||||
){
|
||||
if(is.fail()){
|
||||
boost::throw_exception(
|
||||
archive_exception(archive_exception::stream_error)
|
||||
@@ -163,8 +163,8 @@ bool basic_xml_grammar<CharType>::my_parse(
|
||||
do{
|
||||
val = is.get();
|
||||
arg += val;
|
||||
if(is.fail())
|
||||
return false;
|
||||
if(is.fail())
|
||||
return false;
|
||||
}
|
||||
while(val != delimiter);
|
||||
|
||||
@@ -180,7 +180,7 @@ bool basic_xml_grammar<CharType>::my_parse(
|
||||
|
||||
template<class CharType>
|
||||
bool basic_xml_grammar<CharType>::parse_start_tag(
|
||||
BOOST_DEDUCED_TYPENAME basic_xml_grammar<CharType>::IStream & is
|
||||
BOOST_DEDUCED_TYPENAME basic_xml_grammar<CharType>::IStream & is
|
||||
) {
|
||||
if(is.fail()){
|
||||
boost::throw_exception(
|
||||
@@ -220,7 +220,7 @@ bool basic_xml_grammar<CharType>::parse_string(IStream & is, StringType & s) {
|
||||
|
||||
template<class CharType>
|
||||
basic_xml_grammar<CharType>::basic_xml_grammar(){
|
||||
init_chset();
|
||||
init_chset();
|
||||
S =
|
||||
+(Sch)
|
||||
;
|
||||
@@ -389,7 +389,7 @@ basic_xml_grammar<CharType>::basic_xml_grammar(){
|
||||
|
||||
template<class CharType>
|
||||
void basic_xml_grammar<CharType>::init(IStream & is){
|
||||
init_chset();
|
||||
init_chset();
|
||||
if(! my_parse(is, XMLDecl))
|
||||
boost::throw_exception(
|
||||
xml_archive_exception(xml_archive_exception::xml_archive_parsing_error)
|
||||
@@ -411,10 +411,10 @@ void basic_xml_grammar<CharType>::init(IStream & is){
|
||||
template<class CharType>
|
||||
void basic_xml_grammar<CharType>::windup(IStream & is){
|
||||
if(is.fail())
|
||||
return;
|
||||
// uh-oh - don't exception from code called by a destructor !
|
||||
// so just ignore any failure.
|
||||
my_parse(is, ETag);
|
||||
return;
|
||||
// uh-oh - don't exception from code called by a destructor !
|
||||
// so just ignore any failure.
|
||||
my_parse(is, ETag);
|
||||
}
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace archive {
|
||||
|
||||
std::codecvt_base::result
|
||||
codecvt_null<wchar_t>::do_out(
|
||||
mbstate_t & state,
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * first1,
|
||||
const wchar_t * last1,
|
||||
const wchar_t * & next1,
|
||||
@@ -46,7 +46,7 @@ codecvt_null<wchar_t>::do_out(
|
||||
|
||||
std::codecvt_base::result
|
||||
codecvt_null<wchar_t>::do_in(
|
||||
mbstate_t & state,
|
||||
std::mbstate_t & state,
|
||||
const char * first1,
|
||||
const char * last1,
|
||||
const char * & next1,
|
||||
@@ -64,7 +64,7 @@ codecvt_null<wchar_t>::do_in(
|
||||
if (first1 == last1)
|
||||
break;
|
||||
// Do we have less input characters than needed
|
||||
// for a single output character?
|
||||
// for a single output character?
|
||||
if(static_cast<int>(sizeof(wchar_t)) > (last1 - first1)){
|
||||
next1 = first1;
|
||||
next2 = first2;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
// Translate incoming UTF-8 into UCS-4
|
||||
std::codecvt_base::result utf8_codecvt_facet_wchar_t::do_in(
|
||||
mbstate_t& state,
|
||||
std::mbstate_t& state,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
const char * & from_next,
|
||||
@@ -95,7 +95,7 @@ std::codecvt_base::result utf8_codecvt_facet_wchar_t::do_in(
|
||||
}
|
||||
|
||||
std::codecvt_base::result utf8_codecvt_facet_wchar_t::do_out(
|
||||
mbstate_t & state,
|
||||
std::mbstate_t & state,
|
||||
const wchar_t * from,
|
||||
const wchar_t * from_end,
|
||||
const wchar_t * & from_next,
|
||||
@@ -156,7 +156,7 @@ std::codecvt_base::result utf8_codecvt_facet_wchar_t::do_out(
|
||||
// How many char objects can I process to get <= max_limit
|
||||
// wchar_t objects?
|
||||
int utf8_codecvt_facet_wchar_t::do_length(
|
||||
const mbstate_t &,
|
||||
const std::mbstate_t &,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
size_t max_limit
|
||||
@@ -249,7 +249,7 @@ int utf8_codecvt_facet_wchar_t::get_cont_octet_out_count(
|
||||
// implementation for char
|
||||
|
||||
std::codecvt_base::result utf8_codecvt_facet_char::do_in(
|
||||
mbstate_t & state,
|
||||
std::mbstate_t & state,
|
||||
const char * from,
|
||||
const char * from_end,
|
||||
const char * & from_next,
|
||||
|
||||
@@ -105,27 +105,27 @@ void_upcast(
|
||||
){
|
||||
// if the current candidate doesn't cast to the desired target type
|
||||
if ((*it)->m_base_type == base_type){
|
||||
// if the current candidate casts from the desired source type
|
||||
if ((*it)->m_derived_type == derived_type){
|
||||
// we have a base/derived match - we're done
|
||||
// cast to the intermediate type
|
||||
t_new = (*it)->upcast(t);
|
||||
break;
|
||||
}
|
||||
t_new = void_upcast(derived_type, (*it)->m_derived_type, t, false);
|
||||
if (NULL != t_new){
|
||||
t_new = (*it)->upcast(t_new);
|
||||
if(top){
|
||||
// register the this pair so we will have to go through
|
||||
// keep this expensive search process more than once.
|
||||
new void_cast_detail::void_caster_derived(
|
||||
derived_type,
|
||||
base_type,
|
||||
static_cast<const char*>(t_new) - static_cast<const char*>(t)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// if the current candidate casts from the desired source type
|
||||
if ((*it)->m_derived_type == derived_type){
|
||||
// we have a base/derived match - we're done
|
||||
// cast to the intermediate type
|
||||
t_new = (*it)->upcast(t);
|
||||
break;
|
||||
}
|
||||
t_new = void_upcast(derived_type, (*it)->m_derived_type, t, false);
|
||||
if (NULL != t_new){
|
||||
t_new = (*it)->upcast(t_new);
|
||||
if(top){
|
||||
// register the this pair so we will have to go through
|
||||
// keep this expensive search process more than once.
|
||||
new void_cast_detail::void_caster_derived(
|
||||
derived_type,
|
||||
base_type,
|
||||
static_cast<const char*>(t_new) - static_cast<const char*>(t)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t_new;
|
||||
@@ -161,27 +161,27 @@ void_downcast(
|
||||
){
|
||||
// if the current candidate doesn't cast from the desired target type
|
||||
if ((*it)->m_base_type == base_type){
|
||||
// if the current candidate casts to the desired source type
|
||||
if ((*it)->m_derived_type == derived_type){
|
||||
// we have a base/derived match - we're done
|
||||
// cast to the intermediate type
|
||||
t_new = (*it)->downcast(t);
|
||||
break;
|
||||
}
|
||||
t_new = void_downcast(derived_type, (*it)->m_derived_type, t, false);
|
||||
if (NULL != t_new){
|
||||
t_new = (*it)->downcast(t_new);
|
||||
if(top){
|
||||
// register the this pair so we will have to go through
|
||||
// keep this expensive search process more than once.
|
||||
new void_cast_detail::void_caster_derived(
|
||||
derived_type,
|
||||
base_type,
|
||||
static_cast<const char*>(t) - static_cast<const char*>(t_new)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
// if the current candidate casts to the desired source type
|
||||
if ((*it)->m_derived_type == derived_type){
|
||||
// we have a base/derived match - we're done
|
||||
// cast to the intermediate type
|
||||
t_new = (*it)->downcast(t);
|
||||
break;
|
||||
}
|
||||
t_new = void_downcast(derived_type, (*it)->m_derived_type, t, false);
|
||||
if (NULL != t_new){
|
||||
t_new = (*it)->downcast(t_new);
|
||||
if(top){
|
||||
// register the this pair so we will have to go through
|
||||
// keep this expensive search process more than once.
|
||||
new void_cast_detail::void_caster_derived(
|
||||
derived_type,
|
||||
base_type,
|
||||
static_cast<const char*>(t) - static_cast<const char*>(t_new)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return t_new;
|
||||
|
||||
@@ -23,17 +23,17 @@ using namespace boost::spirit;
|
||||
#if defined(_RWSTD_VER) && ! defined(__SGI_STL_PORT)
|
||||
#include <string>
|
||||
namespace std {
|
||||
template<>
|
||||
inline string &
|
||||
string::replace (
|
||||
char * first1,
|
||||
char * last1,
|
||||
const char * first2,
|
||||
const char * last2
|
||||
){
|
||||
replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
|
||||
return *this;
|
||||
}
|
||||
template<>
|
||||
inline string &
|
||||
string::replace (
|
||||
char * first1,
|
||||
char * last1,
|
||||
const char * first2,
|
||||
const char * last2
|
||||
){
|
||||
replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
|
||||
return *this;
|
||||
}
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
@@ -47,12 +47,12 @@ typedef basic_xml_grammar<char> xml_grammar;
|
||||
|
||||
template<>
|
||||
void xml_grammar::init_chset(){
|
||||
Char = chset_t("\x9\xA\xD\x20-\xFF");
|
||||
Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF");
|
||||
Digit = chset_t("0-9");
|
||||
Extender = chset_t('\xB7');
|
||||
Sch = chset_t("\x20\x9\xD\xA");
|
||||
NameChar = Letter | Digit | chset_p("._:-") | Extender ;
|
||||
Char = chset_t("\x9\xA\xD\x20-\xFF");
|
||||
Letter = chset_t("\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF");
|
||||
Digit = chset_t("0-9");
|
||||
Extender = chset_t('\xB7');
|
||||
Sch = chset_t("\x20\x9\xD\xA");
|
||||
NameChar = Letter | Digit | chset_p("._:-") | Extender ;
|
||||
}
|
||||
|
||||
} // namespace archive
|
||||
|
||||
@@ -24,17 +24,17 @@ using namespace boost::spirit;
|
||||
#if defined(_RWSTD_VER) && ! defined(__SGI_STL_PORT)
|
||||
#include <string>
|
||||
namespace std {
|
||||
template<>
|
||||
inline wstring &
|
||||
wstring::replace (
|
||||
wchar_t * first1,
|
||||
wchar_t * last1,
|
||||
const wchar_t * first2,
|
||||
const wchar_t * last2
|
||||
){
|
||||
replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
|
||||
return *this;
|
||||
}
|
||||
template<>
|
||||
inline wstring &
|
||||
wstring::replace (
|
||||
wchar_t * first1,
|
||||
wchar_t * last1,
|
||||
const wchar_t * first2,
|
||||
const wchar_t * last2
|
||||
){
|
||||
replace(first1-begin(),last1-first1,first2,last2-first2,0,last2-first2);
|
||||
return *this;
|
||||
}
|
||||
} // namespace std
|
||||
#endif
|
||||
|
||||
@@ -145,87 +145,87 @@ const xml_wgrammar::chset_t xml_wgrammar::NameChar =
|
||||
|
||||
template<>
|
||||
void xml_wgrammar::init_chset(){
|
||||
Char = chset_t(
|
||||
#if defined(__GNUC__) && defined(linux)
|
||||
L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD\x10000-\x10FFFF"
|
||||
#else
|
||||
L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD"
|
||||
#endif
|
||||
);
|
||||
Char = chset_t(
|
||||
#if defined(__GNUC__) && defined(linux)
|
||||
L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD\x10000-\x10FFFF"
|
||||
#else
|
||||
L"\x9\xA\xD\x20-\xD7FF\xE000-\xFFFD"
|
||||
#endif
|
||||
);
|
||||
|
||||
Sch = chset_t(L"\x20\x9\xD\xA");
|
||||
Sch = chset_t(L"\x20\x9\xD\xA");
|
||||
|
||||
BaseChar = chset_t(
|
||||
L"\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF\x100-\x131\x134-\x13E"
|
||||
L"\x141-\x148\x14A-\x17E\x180-\x1C3\x1CD-\x1F0\x1F4-\x1F5\x1FA-\x217"
|
||||
L"\x250-\x2A8\x2BB-\x2C1\x386\x388-\x38A\x38C\x38E-\x3A1\x3A3-\x3CE"
|
||||
L"\x3D0-\x3D6\x3DA\x3DC\x3DE\x3E0\x3E2-\x3F3\x401-\x40C\x40E-\x44F"
|
||||
L"\x451-\x45C\x45E-\x481\x490-\x4C4\x4C7-\x4C8\x4CB-\x4CC\x4D0-\x4EB"
|
||||
L"\x4EE-\x4F5\x4F8-\x4F9\x531-\x556\x559\x561-\x586\x5D0-\x5EA"
|
||||
L"\x5F0-\x5F2\x621-\x63A\x641-\x64A\x671-\x6B7\x6BA-\x6BE\x6C0-\x6CE"
|
||||
L"\x6D0-\x6D3\x6D5\x6E5-\x6E6\x905-\x939\x93D\x958-\x961\x985-\x98C"
|
||||
L"\x98F-\x990\x993-\x9A8\x9AA-\x9B0\x9B2\x9B6-\x9B9\x9DC-\x9DD"
|
||||
L"\x9DF-\x9E1\x9F0-\x9F1\xA05-\xA0A\xA0F-\xA10\xA13-\xA28\xA2A-\xA30"
|
||||
L"\xA32-\xA33\xA35-\xA36\xA38-\xA39\xA59-\xA5C\xA5E\xA72-\xA74"
|
||||
L"\xA85-\xA8B\xA8D\xA8F-\xA91\xA93-\xAA8\xAAA-\xAB0\xAB2-\xAB3"
|
||||
L"\xAB5-\xAB9\xABD\xAE0\xB05-\xB0C\xB0F-\xB10\xB13-\xB28\xB2A-\xB30"
|
||||
L"\xB32-\xB33\xB36-\xB39\xB3D\xB5C-\xB5D\xB5F-\xB61\xB85-\xB8A"
|
||||
L"\xB8E-\xB90\xB92-\xB95\xB99-\xB9A\xB9C\xB9E-\xB9F\xBA3-\xBA4"
|
||||
L"\xBA8-\xBAA\xBAE-\xBB5\xBB7-\xBB9\xC05-\xC0C\xC0E-\xC10\xC12-\xC28"
|
||||
L"\xC2A-\xC33\xC35-\xC39\xC60-\xC61\xC85-\xC8C\xC8E-\xC90\xC92-\xCA8"
|
||||
L"\xCAA-\xCB3\xCB5-\xCB9\xCDE\xCE0-\xCE1\xD05-\xD0C\xD0E-\xD10"
|
||||
L"\xD12-\xD28\xD2A-\xD39\xD60-\xD61\xE01-\xE2E\xE30\xE32-\xE33"
|
||||
L"\xE40-\xE45\xE81-\xE82\xE84\xE87-\xE88\xE8A\xE8D\xE94-\xE97"
|
||||
L"\xE99-\xE9F\xEA1-\xEA3\xEA5\xEA7\xEAA-\xEAB\xEAD-\xEAE\xEB0"
|
||||
L"\xEB2-\xEB3\xEBD\xEC0-\xEC4\xF40-\xF47\xF49-\xF69\x10A0-\x10C5"
|
||||
L"\x10D0-\x10F6\x1100\x1102-\x1103\x1105-\x1107\x1109\x110B-\x110C"
|
||||
L"\x110E-\x1112\x113C\x113E\x1140\x114C\x114E\x1150\x1154-\x1155"
|
||||
L"\x1159\x115F-\x1161\x1163\x1165\x1167\x1169\x116D-\x116E"
|
||||
L"\x1172-\x1173\x1175\x119E\x11A8\x11AB\x11AE-\x11AF\x11B7-\x11B8"
|
||||
L"\x11BA\x11BC-\x11C2\x11EB\x11F0\x11F9\x1E00-\x1E9B\x1EA0-\x1EF9"
|
||||
L"\x1F00-\x1F15\x1F18-\x1F1D\x1F20-\x1F45\x1F48-\x1F4D\x1F50-\x1F57"
|
||||
L"\x1F59\x1F5B\x1F5D\x1F5F-\x1F7D\x1F80-\x1FB4\x1FB6-\x1FBC\x1FBE"
|
||||
L"\x1FC2-\x1FC4\x1FC6-\x1FCC\x1FD0-\x1FD3\x1FD6-\x1FDB\x1FE0-\x1FEC"
|
||||
L"\x1FF2-\x1FF4\x1FF6-\x1FFC\x2126\x212A-\x212B\x212E\x2180-\x2182"
|
||||
L"\x3041-\x3094\x30A1-\x30FA\x3105-\x312C\xAC00-\xD7A3"
|
||||
);
|
||||
BaseChar = chset_t(
|
||||
L"\x41-\x5A\x61-\x7A\xC0-\xD6\xD8-\xF6\xF8-\xFF\x100-\x131\x134-\x13E"
|
||||
L"\x141-\x148\x14A-\x17E\x180-\x1C3\x1CD-\x1F0\x1F4-\x1F5\x1FA-\x217"
|
||||
L"\x250-\x2A8\x2BB-\x2C1\x386\x388-\x38A\x38C\x38E-\x3A1\x3A3-\x3CE"
|
||||
L"\x3D0-\x3D6\x3DA\x3DC\x3DE\x3E0\x3E2-\x3F3\x401-\x40C\x40E-\x44F"
|
||||
L"\x451-\x45C\x45E-\x481\x490-\x4C4\x4C7-\x4C8\x4CB-\x4CC\x4D0-\x4EB"
|
||||
L"\x4EE-\x4F5\x4F8-\x4F9\x531-\x556\x559\x561-\x586\x5D0-\x5EA"
|
||||
L"\x5F0-\x5F2\x621-\x63A\x641-\x64A\x671-\x6B7\x6BA-\x6BE\x6C0-\x6CE"
|
||||
L"\x6D0-\x6D3\x6D5\x6E5-\x6E6\x905-\x939\x93D\x958-\x961\x985-\x98C"
|
||||
L"\x98F-\x990\x993-\x9A8\x9AA-\x9B0\x9B2\x9B6-\x9B9\x9DC-\x9DD"
|
||||
L"\x9DF-\x9E1\x9F0-\x9F1\xA05-\xA0A\xA0F-\xA10\xA13-\xA28\xA2A-\xA30"
|
||||
L"\xA32-\xA33\xA35-\xA36\xA38-\xA39\xA59-\xA5C\xA5E\xA72-\xA74"
|
||||
L"\xA85-\xA8B\xA8D\xA8F-\xA91\xA93-\xAA8\xAAA-\xAB0\xAB2-\xAB3"
|
||||
L"\xAB5-\xAB9\xABD\xAE0\xB05-\xB0C\xB0F-\xB10\xB13-\xB28\xB2A-\xB30"
|
||||
L"\xB32-\xB33\xB36-\xB39\xB3D\xB5C-\xB5D\xB5F-\xB61\xB85-\xB8A"
|
||||
L"\xB8E-\xB90\xB92-\xB95\xB99-\xB9A\xB9C\xB9E-\xB9F\xBA3-\xBA4"
|
||||
L"\xBA8-\xBAA\xBAE-\xBB5\xBB7-\xBB9\xC05-\xC0C\xC0E-\xC10\xC12-\xC28"
|
||||
L"\xC2A-\xC33\xC35-\xC39\xC60-\xC61\xC85-\xC8C\xC8E-\xC90\xC92-\xCA8"
|
||||
L"\xCAA-\xCB3\xCB5-\xCB9\xCDE\xCE0-\xCE1\xD05-\xD0C\xD0E-\xD10"
|
||||
L"\xD12-\xD28\xD2A-\xD39\xD60-\xD61\xE01-\xE2E\xE30\xE32-\xE33"
|
||||
L"\xE40-\xE45\xE81-\xE82\xE84\xE87-\xE88\xE8A\xE8D\xE94-\xE97"
|
||||
L"\xE99-\xE9F\xEA1-\xEA3\xEA5\xEA7\xEAA-\xEAB\xEAD-\xEAE\xEB0"
|
||||
L"\xEB2-\xEB3\xEBD\xEC0-\xEC4\xF40-\xF47\xF49-\xF69\x10A0-\x10C5"
|
||||
L"\x10D0-\x10F6\x1100\x1102-\x1103\x1105-\x1107\x1109\x110B-\x110C"
|
||||
L"\x110E-\x1112\x113C\x113E\x1140\x114C\x114E\x1150\x1154-\x1155"
|
||||
L"\x1159\x115F-\x1161\x1163\x1165\x1167\x1169\x116D-\x116E"
|
||||
L"\x1172-\x1173\x1175\x119E\x11A8\x11AB\x11AE-\x11AF\x11B7-\x11B8"
|
||||
L"\x11BA\x11BC-\x11C2\x11EB\x11F0\x11F9\x1E00-\x1E9B\x1EA0-\x1EF9"
|
||||
L"\x1F00-\x1F15\x1F18-\x1F1D\x1F20-\x1F45\x1F48-\x1F4D\x1F50-\x1F57"
|
||||
L"\x1F59\x1F5B\x1F5D\x1F5F-\x1F7D\x1F80-\x1FB4\x1FB6-\x1FBC\x1FBE"
|
||||
L"\x1FC2-\x1FC4\x1FC6-\x1FCC\x1FD0-\x1FD3\x1FD6-\x1FDB\x1FE0-\x1FEC"
|
||||
L"\x1FF2-\x1FF4\x1FF6-\x1FFC\x2126\x212A-\x212B\x212E\x2180-\x2182"
|
||||
L"\x3041-\x3094\x30A1-\x30FA\x3105-\x312C\xAC00-\xD7A3"
|
||||
);
|
||||
|
||||
Ideographic = chset_t(L"\x4E00-\x9FA5\x3007\x3021-\x3029");
|
||||
Ideographic = chset_t(L"\x4E00-\x9FA5\x3007\x3021-\x3029");
|
||||
|
||||
Letter = BaseChar | Ideographic;
|
||||
Letter = BaseChar | Ideographic;
|
||||
|
||||
CombiningChar = chset_t(
|
||||
L"\x0300-\x0345\x0360-\x0361\x0483-\x0486\x0591-\x05A1\x05A3-\x05B9"
|
||||
L"\x05BB-\x05BD\x05BF\x05C1-\x05C2\x05C4\x064B-\x0652\x0670"
|
||||
L"\x06D6-\x06DC\x06DD-\x06DF\x06E0-\x06E4\x06E7-\x06E8\x06EA-\x06ED"
|
||||
L"\x0901-\x0903\x093C\x093E-\x094C\x094D\x0951-\x0954\x0962-\x0963"
|
||||
L"\x0981-\x0983\x09BC\x09BE\x09BF\x09C0-\x09C4\x09C7-\x09C8"
|
||||
L"\x09CB-\x09CD\x09D7\x09E2-\x09E3\x0A02\x0A3C\x0A3E\x0A3F"
|
||||
L"\x0A40-\x0A42\x0A47-\x0A48\x0A4B-\x0A4D\x0A70-\x0A71\x0A81-\x0A83"
|
||||
L"\x0ABC\x0ABE-\x0AC5\x0AC7-\x0AC9\x0ACB-\x0ACD\x0B01-\x0B03\x0B3C"
|
||||
L"\x0B3E-\x0B43\x0B47-\x0B48\x0B4B-\x0B4D\x0B56-\x0B57\x0B82-\x0B83"
|
||||
L"\x0BBE-\x0BC2\x0BC6-\x0BC8\x0BCA-\x0BCD\x0BD7\x0C01-\x0C03"
|
||||
L"\x0C3E-\x0C44\x0C46-\x0C48\x0C4A-\x0C4D\x0C55-\x0C56\x0C82-\x0C83"
|
||||
L"\x0CBE-\x0CC4\x0CC6-\x0CC8\x0CCA-\x0CCD\x0CD5-\x0CD6\x0D02-\x0D03"
|
||||
L"\x0D3E-\x0D43\x0D46-\x0D48\x0D4A-\x0D4D\x0D57\x0E31\x0E34-\x0E3A"
|
||||
L"\x0E47-\x0E4E\x0EB1\x0EB4-\x0EB9\x0EBB-\x0EBC\x0EC8-\x0ECD"
|
||||
L"\x0F18-\x0F19\x0F35\x0F37\x0F39\x0F3E\x0F3F\x0F71-\x0F84"
|
||||
L"\x0F86-\x0F8B\x0F90-\x0F95\x0F97\x0F99-\x0FAD\x0FB1-\x0FB7\x0FB9"
|
||||
L"\x20D0-\x20DC\x20E1\x302A-\x302F\x3099\x309A"
|
||||
);
|
||||
CombiningChar = chset_t(
|
||||
L"\x0300-\x0345\x0360-\x0361\x0483-\x0486\x0591-\x05A1\x05A3-\x05B9"
|
||||
L"\x05BB-\x05BD\x05BF\x05C1-\x05C2\x05C4\x064B-\x0652\x0670"
|
||||
L"\x06D6-\x06DC\x06DD-\x06DF\x06E0-\x06E4\x06E7-\x06E8\x06EA-\x06ED"
|
||||
L"\x0901-\x0903\x093C\x093E-\x094C\x094D\x0951-\x0954\x0962-\x0963"
|
||||
L"\x0981-\x0983\x09BC\x09BE\x09BF\x09C0-\x09C4\x09C7-\x09C8"
|
||||
L"\x09CB-\x09CD\x09D7\x09E2-\x09E3\x0A02\x0A3C\x0A3E\x0A3F"
|
||||
L"\x0A40-\x0A42\x0A47-\x0A48\x0A4B-\x0A4D\x0A70-\x0A71\x0A81-\x0A83"
|
||||
L"\x0ABC\x0ABE-\x0AC5\x0AC7-\x0AC9\x0ACB-\x0ACD\x0B01-\x0B03\x0B3C"
|
||||
L"\x0B3E-\x0B43\x0B47-\x0B48\x0B4B-\x0B4D\x0B56-\x0B57\x0B82-\x0B83"
|
||||
L"\x0BBE-\x0BC2\x0BC6-\x0BC8\x0BCA-\x0BCD\x0BD7\x0C01-\x0C03"
|
||||
L"\x0C3E-\x0C44\x0C46-\x0C48\x0C4A-\x0C4D\x0C55-\x0C56\x0C82-\x0C83"
|
||||
L"\x0CBE-\x0CC4\x0CC6-\x0CC8\x0CCA-\x0CCD\x0CD5-\x0CD6\x0D02-\x0D03"
|
||||
L"\x0D3E-\x0D43\x0D46-\x0D48\x0D4A-\x0D4D\x0D57\x0E31\x0E34-\x0E3A"
|
||||
L"\x0E47-\x0E4E\x0EB1\x0EB4-\x0EB9\x0EBB-\x0EBC\x0EC8-\x0ECD"
|
||||
L"\x0F18-\x0F19\x0F35\x0F37\x0F39\x0F3E\x0F3F\x0F71-\x0F84"
|
||||
L"\x0F86-\x0F8B\x0F90-\x0F95\x0F97\x0F99-\x0FAD\x0FB1-\x0FB7\x0FB9"
|
||||
L"\x20D0-\x20DC\x20E1\x302A-\x302F\x3099\x309A"
|
||||
);
|
||||
|
||||
Digit = chset_t(
|
||||
L"\x0030-\x0039\x0660-\x0669\x06F0-\x06F9\x0966-\x096F\x09E6-\x09EF"
|
||||
L"\x0A66-\x0A6F\x0AE6-\x0AEF\x0B66-\x0B6F\x0BE7-\x0BEF\x0C66-\x0C6F"
|
||||
L"\x0CE6-\x0CEF\x0D66-\x0D6F\x0E50-\x0E59\x0ED0-\x0ED9\x0F20-\x0F29"
|
||||
);
|
||||
Digit = chset_t(
|
||||
L"\x0030-\x0039\x0660-\x0669\x06F0-\x06F9\x0966-\x096F\x09E6-\x09EF"
|
||||
L"\x0A66-\x0A6F\x0AE6-\x0AEF\x0B66-\x0B6F\x0BE7-\x0BEF\x0C66-\x0C6F"
|
||||
L"\x0CE6-\x0CEF\x0D66-\x0D6F\x0E50-\x0E59\x0ED0-\x0ED9\x0F20-\x0F29"
|
||||
);
|
||||
|
||||
Extender = chset_t(
|
||||
L"\x00B7\x02D0\x02D1\x0387\x0640\x0E46\x0EC6\x3005\x3031-\x3035"
|
||||
L"\x309D-\x309E\x30FC-\x30FE"
|
||||
);
|
||||
Extender = chset_t(
|
||||
L"\x00B7\x02D0\x02D1\x0387\x0640\x0E46\x0EC6\x3005\x3031-\x3035"
|
||||
L"\x309D-\x309E\x30FC-\x30FE"
|
||||
);
|
||||
|
||||
NameChar =
|
||||
NameChar =
|
||||
Letter
|
||||
| Digit
|
||||
| L'.'
|
||||
@@ -234,7 +234,7 @@ void xml_wgrammar::init_chset(){
|
||||
| L':'
|
||||
| CombiningChar
|
||||
| Extender
|
||||
;
|
||||
;
|
||||
}
|
||||
} // namespace archive
|
||||
} // namespace boost
|
||||
|
||||
20
test/A.hpp
20
test/A.hpp
@@ -58,17 +58,17 @@ private:
|
||||
ar & BOOST_SERIALIZATION_NVP(g);
|
||||
#endif
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551 )
|
||||
int i;
|
||||
if(Archive::is_saving::value){
|
||||
i = l;
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
}
|
||||
else{
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
l = i;
|
||||
}
|
||||
int i;
|
||||
if(Archive::is_saving::value){
|
||||
i = l;
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
}
|
||||
else{
|
||||
ar & BOOST_SERIALIZATION_NVP(i);
|
||||
l = i;
|
||||
}
|
||||
#else
|
||||
ar & BOOST_SERIALIZATION_NVP(l);
|
||||
ar & BOOST_SERIALIZATION_NVP(l);
|
||||
#endif
|
||||
ar & BOOST_SERIALIZATION_NVP(m);
|
||||
ar & BOOST_SERIALIZATION_NVP(n);
|
||||
|
||||
40
test/Jamfile
40
test/Jamfile
@@ -68,24 +68,24 @@ rule run-invoke ( test-name : sources * : defn * )
|
||||
if $(BOOST_SERIALIZATION_TEST_RELEASE) {
|
||||
return [
|
||||
run
|
||||
$(sources)
|
||||
<lib>../../test/build/boost_test_exec_monitor
|
||||
<lib>../../serialization/build/boost_serialization
|
||||
$(sources)
|
||||
<lib>../../test/build/boost_test_exec_monitor
|
||||
<lib>../../serialization/build/boost_serialization
|
||||
: # args
|
||||
: # input files
|
||||
: # requirements
|
||||
# <threading>single
|
||||
# <runtime-link>static
|
||||
<stlport-iostream>on
|
||||
<borland><*><cxxflags>"-w-8080 -w-8071 -w-8057"
|
||||
# <threading>single
|
||||
# <runtime-link>static
|
||||
<stlport-iostream>on
|
||||
<borland><*><cxxflags>"-w-8080 -w-8071 -w-8057"
|
||||
<borland-5.5.1><*><cxxflags>"-w-8080 -w-8071 -w-8057"
|
||||
<borland-5.6.4><*><cxxflags>"-w-8080 -w-8071 -w-8057"
|
||||
<define>$(defn)
|
||||
<include>$(BOOST_ROOT)
|
||||
<define>$(defn)
|
||||
<include>$(BOOST_ROOT)
|
||||
: # name
|
||||
$(test-name)_release
|
||||
$(test-name)_release
|
||||
: # default-build
|
||||
release
|
||||
release
|
||||
] ;
|
||||
}
|
||||
}
|
||||
@@ -103,10 +103,10 @@ rule test-bsl-run_archive ( test-name : archive-name : sources * ) {
|
||||
return [
|
||||
run-invoke $(test-name)_$(archive-name)
|
||||
:
|
||||
$(test-name).cpp $(sources).cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
$(test-name).cpp $(sources).cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
:
|
||||
BOOST_ARCHIVE_TEST=$(archive-name).hpp
|
||||
BOOST_ARCHIVE_TEST=$(archive-name).hpp
|
||||
] ;
|
||||
case "*" :
|
||||
return [
|
||||
@@ -127,7 +127,7 @@ rule test-bsl-run_files ( test-name ) {
|
||||
for local defn in $(BOOST_ARCHIVE_LIST) {
|
||||
test-bsl-run_archive $(test-name) : $(defn:LB) ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test-suite "serialization" :
|
||||
[ test-bsl-run_files test_array ]
|
||||
@@ -182,14 +182,14 @@ if $(BOOST_SERIALIZATION_TEST) {
|
||||
[
|
||||
run-invoke test_codecvt_null
|
||||
:
|
||||
test_codecvt_null.cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
test_codecvt_null.cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
]
|
||||
[
|
||||
run-invoke test_utf8_codecvt
|
||||
:
|
||||
test_utf8_codecvt.cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
test_utf8_codecvt.cpp
|
||||
<lib>../../../libs/serialization/build/boost_wserialization
|
||||
]
|
||||
|
||||
# demos
|
||||
@@ -213,5 +213,5 @@ if $(BOOST_SERIALIZATION_TEST) {
|
||||
# should compile
|
||||
[ compile test_const.cpp ]
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
// binary_archive
|
||||
#include <boost/archive/binary_oarchive.hpp>
|
||||
typedef boost::archive::binary_oarchive test_oarchive;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
// binary_warchive
|
||||
#include <boost/archive/binary_woarchive.hpp>
|
||||
typedef boost::archive::binary_woarchive test_oarchive;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <boost/archive/polymorphic_binary_oarchive.hpp>
|
||||
typedef boost::archive::polymorphic_binary_oarchive test_oarchive;
|
||||
typedef std::ofstream test_ostream;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <boost/archive/polymorphic_text_oarchive.hpp>
|
||||
typedef boost::archive::polymorphic_text_oarchive test_oarchive;
|
||||
typedef std::ofstream test_ostream;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <boost/archive/polymorphic_text_woarchive.hpp>
|
||||
typedef boost::archive::polymorphic_text_woarchive test_oarchive;
|
||||
typedef std::wofstream test_ostream;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <boost/archive/polymorphic_xml_oarchive.hpp>
|
||||
typedef boost::archive::polymorphic_xml_oarchive test_oarchive;
|
||||
typedef std::ofstream test_ostream;
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
#include <boost/archive/polymorphic_xml_woarchive.hpp>
|
||||
typedef boost::archive::polymorphic_xml_woarchive test_oarchive;
|
||||
typedef std::wofstream test_ostream;
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// file includes for testing a custom archive.
|
||||
// (C) Copyright 2002-4 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// See http://www.boost.org for updates, documentation, and revision history.// file includes for testing a custom archive.
|
||||
// as an example this tests the portable binary archive
|
||||
|
||||
// #include output archive header
|
||||
|
||||
@@ -25,5 +25,4 @@ runtest VC7.1
|
||||
TOOLS=msvc6
|
||||
makepath
|
||||
runtest msvc
|
||||
|
||||
|
||||
runtest msvc-stlport
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
// should pass compilation and execution
|
||||
|
||||
#include <fstream>
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -84,7 +92,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
}
|
||||
BOOST_CATCH (boost::archive::archive_exception ae){}
|
||||
}
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
|
||||
// should pass compilation and execution
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdlib> // for rand()
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{ using ::rand; }
|
||||
namespace std{
|
||||
using ::rand;
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -30,8 +33,8 @@ class A {
|
||||
template<class Archive>
|
||||
void serialize(Archive & ar, const unsigned int /* file_version */){
|
||||
ar & boost::serialization::make_nvp(
|
||||
"data",
|
||||
boost::serialization::make_binary_object(data, sizeof(data))
|
||||
"data",
|
||||
boost::serialization::make_binary_object(data, sizeof(data))
|
||||
);
|
||||
}
|
||||
|
||||
@@ -79,7 +82,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
}
|
||||
BOOST_CHECK(i == i1);
|
||||
BOOST_CHECK(a == a1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,14 @@
|
||||
#include <locale>
|
||||
#include <vector>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include <boost/archive/add_facet.hpp>
|
||||
@@ -73,10 +80,10 @@ int test_main( int /* argc */, char* /* argv */[] ) {
|
||||
ofs.open(testfile, std::ios::binary);
|
||||
std::copy(
|
||||
td::wchar_encoding,
|
||||
// borland 5.60 complains about this
|
||||
// borland 5.60 complains about this
|
||||
// td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t),
|
||||
// so use this instead
|
||||
td::wchar_encoding + 13,
|
||||
// so use this instead
|
||||
td::wchar_encoding + 13,
|
||||
boost::archive::iterators::ostream_iterator<wchar_t>(ofs)
|
||||
);
|
||||
}
|
||||
@@ -85,11 +92,11 @@ int test_main( int /* argc */, char* /* argv */[] ) {
|
||||
std::wifstream ifs;
|
||||
ifs.imbue(*null_locale);
|
||||
ifs.open(testfile, std::ios::binary);
|
||||
ok = std::equal(
|
||||
ok = std::equal(
|
||||
td::wchar_encoding,
|
||||
// borland 5.60 complains about this
|
||||
// borland 5.60 complains about this
|
||||
// td::wchar_encoding + sizeof(td::wchar_encoding)/sizeof(wchar_t),
|
||||
// so use this instead
|
||||
// so use this instead
|
||||
td::wchar_encoding + 13,
|
||||
boost::archive::iterators::istream_iterator<wchar_t>(ifs)
|
||||
);
|
||||
@@ -105,14 +112,14 @@ int test_main( int /* argc */, char* /* argv */[] ) {
|
||||
|
||||
std::wifstream ifs("testfile2");
|
||||
ifs.imbue(*null_locale);
|
||||
int i2;
|
||||
int i2;
|
||||
ifs >> i2;
|
||||
BOOST_CHECK(i == i2);
|
||||
ifs.close();
|
||||
}
|
||||
|
||||
delete null_locale;
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include "test_tools.hpp"
|
||||
|
||||
@@ -51,7 +59,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
ia >> boost::serialization::make_nvp("c", c1);
|
||||
}
|
||||
BOOST_CHECK(c == c1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "A.hpp"
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -109,7 +117,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
oa << BOOST_SERIALIZATION_NVP(k);
|
||||
}
|
||||
BOOST_CATCH (boost::archive::archive_exception ae){
|
||||
exception = ae;
|
||||
exception = ae;
|
||||
}
|
||||
BOOST_CHECK(
|
||||
exception.code == boost::archive::archive_exception::pointer_conflict
|
||||
@@ -121,19 +129,19 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
test_istream is(testfile, TEST_STREAM_FLAGS);
|
||||
test_iarchive ia(is);
|
||||
exception = boost::archive::archive_exception(
|
||||
boost::archive::archive_exception::no_exception
|
||||
boost::archive::archive_exception::no_exception
|
||||
);
|
||||
BOOST_TRY {
|
||||
ia >> BOOST_SERIALIZATION_NVP(k);
|
||||
}
|
||||
BOOST_CATCH (boost::archive::archive_exception ae){
|
||||
exception = ae;
|
||||
exception = ae;
|
||||
}
|
||||
BOOST_CHECK(
|
||||
exception.code == boost::archive::archive_exception::pointer_conflict
|
||||
);
|
||||
}
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include <boost/serialization/split_member.hpp>
|
||||
#include <boost/serialization/vector.hpp>
|
||||
@@ -114,7 +122,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
|
||||
//identify the leaks
|
||||
BOOST_CHECK(A::objcount == 0);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/deque.hpp>
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
@@ -37,7 +45,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
}
|
||||
BOOST_CHECK(adeque == adeque1);
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
#include "test_tools.hpp"
|
||||
|
||||
@@ -126,7 +134,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
|
||||
save_derived(testfile);
|
||||
load_derived(testfile);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include "B.hpp"
|
||||
@@ -34,7 +42,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
}
|
||||
BOOST_CHECK(tb != tb1);
|
||||
BOOST_CHECK(*tb == *tb1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,14 @@
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/serialization/string.hpp>
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/map.hpp>
|
||||
#include <boost/serialization/utility.hpp>
|
||||
|
||||
@@ -57,8 +64,8 @@ public:
|
||||
{
|
||||
return i == another.i && m == another.m;
|
||||
}
|
||||
// make virtual to evade gcc quirk
|
||||
virtual ~base() {};
|
||||
// make virtual to evade gcc quirk
|
||||
virtual ~base() {};
|
||||
private:
|
||||
int i;
|
||||
std::map<int, std::string> m;
|
||||
@@ -162,6 +169,6 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_CHECK(1 == save_count);
|
||||
BOOST_CHECK(1 == load_count);
|
||||
BOOST_CHECK(b2 == b);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
|
||||
@@ -114,7 +122,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
|
||||
save_exported(testfile);
|
||||
load_exported(testfile);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -132,9 +132,9 @@ void test_transform_width(unsigned int size){
|
||||
|
||||
BOOST_CHECK(
|
||||
std::equal(
|
||||
rawdata,
|
||||
rawdata + size,
|
||||
translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin()))
|
||||
rawdata,
|
||||
rawdata + size,
|
||||
translator2(BOOST_MAKE_PFTO_WRAPPER(v6.begin()))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -47,11 +47,11 @@ void test_base64(){
|
||||
typedef
|
||||
boost::archive::iterators::insert_linebreaks<
|
||||
boost::archive::iterators::base64_from_binary<
|
||||
boost::archive::iterators::transform_width<
|
||||
CharType *
|
||||
,6
|
||||
,sizeof(CharType) * 8
|
||||
>
|
||||
boost::archive::iterators::transform_width<
|
||||
CharType *
|
||||
,6
|
||||
,sizeof(CharType) * 8
|
||||
>
|
||||
>
|
||||
,72
|
||||
>
|
||||
@@ -67,9 +67,9 @@ void test_base64(){
|
||||
typedef
|
||||
boost::archive::iterators::transform_width<
|
||||
boost::archive::iterators::binary_from_base64<
|
||||
boost::archive::iterators::remove_whitespace<
|
||||
BOOST_DEDUCED_TYPENAME text_base64_type::iterator
|
||||
>
|
||||
boost::archive::iterators::remove_whitespace<
|
||||
BOOST_DEDUCED_TYPENAME text_base64_type::iterator
|
||||
>
|
||||
>,
|
||||
sizeof(CharType) * 8,
|
||||
6
|
||||
@@ -77,9 +77,9 @@ void test_base64(){
|
||||
|
||||
BOOST_CHECK(
|
||||
std::equal(
|
||||
rawdata,
|
||||
rawdata + size,
|
||||
translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin()))
|
||||
rawdata,
|
||||
rawdata + size,
|
||||
translate_in(BOOST_MAKE_PFTO_WRAPPER(text_base64.begin()))
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
A a;
|
||||
B b;
|
||||
std::string filename;
|
||||
filename += boost::archive::tmpdir();
|
||||
filename += '/';
|
||||
filename += boost::archive::tmpdir();
|
||||
filename += '/';
|
||||
filename += BOOST_PP_STRINGIZE(testfile_);
|
||||
filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST);
|
||||
in(filename.c_str(), a, b);
|
||||
|
||||
@@ -81,8 +81,8 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
A a;
|
||||
B b;
|
||||
std::string filename;
|
||||
filename += boost::archive::tmpdir();
|
||||
filename += '/';
|
||||
filename += boost::archive::tmpdir();
|
||||
filename += '/';
|
||||
filename += BOOST_PP_STRINGIZE(testfile_);
|
||||
filename += BOOST_PP_STRINGIZE(BOOST_ARCHIVE_TEST);
|
||||
out(filename.c_str(), a, b);
|
||||
|
||||
@@ -11,6 +11,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/level.hpp>
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
#include "test_tools.hpp"
|
||||
@@ -53,7 +61,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
A a;
|
||||
out(testfile, a);
|
||||
in(testfile, a);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/list.hpp>
|
||||
#ifdef BOOST_HAS_SLIST
|
||||
#include <boost/serialization/slist.hpp>
|
||||
@@ -59,7 +67,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_CHECK(aslist == aslist1);
|
||||
|
||||
#endif
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/checked_delete.hpp>
|
||||
@@ -105,7 +112,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
boost::checked_deleter<A>()
|
||||
);
|
||||
#endif
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_CHECK(amultimap == amultimap1);
|
||||
#endif
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,25 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// test_mi.cpp
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// test of serialization of base classes with multiple inheritance
|
||||
// contributed by Peter Dimov
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -113,6 +129,6 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
std::cout << "pb->get_y(): " << pb->get_y() << std::endl;
|
||||
|
||||
delete pc;
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
@@ -1,16 +1,21 @@
|
||||
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
||||
// test_mult_archive_types.cpp
|
||||
//
|
||||
|
||||
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// See http://www.boost.org for updates, documentation, and revision history.
|
||||
|
||||
#include <cstdio>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/text_oarchive.hpp>
|
||||
#include <boost/archive/text_iarchive.hpp>
|
||||
#include <boost/archive/xml_oarchive.hpp>
|
||||
@@ -89,7 +94,7 @@ void test_save_and_load(A * first, A * second)
|
||||
ia >> BOOST_SERIALIZATION_NVP(second);
|
||||
}
|
||||
BOOST_CHECK(first == second);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
}
|
||||
|
||||
using namespace boost::archive;
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include "D.hpp"
|
||||
@@ -32,7 +40,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
ia >> boost::serialization::make_nvp("a", a1);
|
||||
}
|
||||
BOOST_CHECK(a == a1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
||||
@@ -233,7 +241,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
save_derived(testfile);
|
||||
load_derived(testfile);
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdlib> // for rand()
|
||||
#include <cstdlib> // for rand(), remove()
|
||||
#include <cmath> // for fabs()
|
||||
|
||||
#include <boost/config.hpp>
|
||||
@@ -22,6 +22,7 @@
|
||||
namespace std{
|
||||
using ::rand;
|
||||
using ::fabs;
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -188,7 +189,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
save(testfile);
|
||||
load(testfile);
|
||||
BOOST_CHECK(0 == A::count);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,14 +13,15 @@
|
||||
// b) usage of a non-default constructor
|
||||
|
||||
#include <fstream>
|
||||
#include <cstdlib> // for rand()
|
||||
#include <cstdlib> // for rand(), remove
|
||||
#include <cmath> // for fabs()
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::rand;
|
||||
using ::fabs;
|
||||
using ::rand;
|
||||
using ::fabs;
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -163,7 +164,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_REQUIRE(NULL != testfile);
|
||||
save(testfile);
|
||||
load(testfile);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
#include <boost/serialization/base_object.hpp>
|
||||
|
||||
@@ -71,7 +79,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_REQUIRE(NULL != testfile);
|
||||
save(testfile);
|
||||
load(testfile);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include <boost/serialization/nvp.hpp>
|
||||
@@ -50,7 +58,7 @@ int test_main( int argc, char* argv[] )
|
||||
}
|
||||
BOOST_CHECK(b == *bptr1);
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/serialization/optional.hpp>
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
@@ -44,7 +52,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
BOOST_CHECK(aoptional1 == aoptional1a);
|
||||
BOOST_CHECK(aoptional2 == aoptional2a);
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_ARCHIVE_TEST)
|
||||
#define BOOST_ARCHIVE_TEST polymorphic_text_archive.hpp
|
||||
#endif
|
||||
@@ -40,6 +48,6 @@ int test_main(int /* argc */, char * /* argv */ [])
|
||||
ia_interface >> BOOST_SERIALIZATION_NVP(d1);
|
||||
}
|
||||
BOOST_CHECK(d == d1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include "test_tools.hpp"
|
||||
|
||||
#include "J.hpp"
|
||||
@@ -34,7 +42,7 @@ int test_main( int /* argc */, char* /* argv */[] )
|
||||
ia >> BOOST_SERIALIZATION_NVP(j1);
|
||||
}
|
||||
BOOST_CHECK(j == j1);
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,14 @@
|
||||
|
||||
#include <fstream>
|
||||
|
||||
#include <cstdio> // remove
|
||||
#include <boost/config.hpp>
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
||||
namespace std{
|
||||
using ::remove;
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <boost/archive/archive_exception.hpp>
|
||||
#include "test_tools.hpp"
|
||||
|
||||
@@ -223,7 +231,7 @@ test_main( int /* argc */, char* /* argv */[] )
|
||||
save_registered(testfile);
|
||||
load_registered(testfile);
|
||||
|
||||
std::remove(testfile);
|
||||
std::remove(testfile);
|
||||
return boost::exit_success;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user