fix doc example typo
[boost.git] / boost / serialization / string.hpp
blob36d15942a878fdcaf41e0f498cec9011330002fe
1 #ifndef BOOST_SERIALIZATION_STRING_HPP
2 #define BOOST_SERIALIZATION_STRING_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
6 # pragma once
7 #endif
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
10 // serialization/string.hpp:
11 // serialization for stl string templates
13 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
14 // Use, modification and distribution is subject to the Boost Software
15 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
16 // http://www.boost.org/LICENSE_1_0.txt)
18 // See http://www.boost.org for updates, documentation, and revision history.
20 #include <string>
22 #include <boost/config.hpp>
23 #include <boost/serialization/level.hpp>
25 BOOST_CLASS_IMPLEMENTATION(std::string, boost::serialization::primitive_type)
26 #ifndef BOOST_NO_STD_WSTRING
27 BOOST_CLASS_IMPLEMENTATION(std::wstring, boost::serialization::primitive_type)
28 #endif
30 // left over from a previous incarnation - strings are now always primitive types
31 #if 0
32 #include <string>
33 #include <boost/serialization/collections_save_imp.hpp>
34 #include <boost/serialization/collections_load_imp.hpp>
35 #include <boost/serialization/split_free.hpp>
37 namespace boost {
38 namespace serialization {
40 // basic_string - general case
41 template<class Archive, class U, class Allocator>
42 inline void save(
43 Archive & ar,
44 const std::basic_string<U, Allocator> &t,
45 const unsigned int file_version
47 boost::serialization::stl::save_collection<
48 Archive, std::basic_string<U, Allocator>
49 >(ar, t);
52 template<class Archive, class U, class Allocator>
53 inline void load(
54 Archive & ar,
55 std::basic_string<U, Allocator> &t,
56 const unsigned int file_version
58 boost::serialization::stl::load_collection<
59 Archive,
60 std::basic_string<U, Allocator>,
61 boost::serialization::stl::archive_input_seq<
62 Archive,
63 std::basic_string<U, Allocator>
65 boost::serialization::stl::reserve_imp<
66 std::basic_string<U, Allocator>
68 >(ar, t);
71 // split non-intrusive serialization function member into separate
72 // non intrusive save/load member functions
73 template<class Archive, class U, class Allocator>
74 inline void serialize(
75 Archive & ar,
76 std::basic_string<U, Allocator> & t,
77 const unsigned int file_version
79 boost::serialization::split_free(ar, t, file_version);
82 } // serialization
83 } // namespace boost
85 #include <boost/serialization/collection_traits.hpp>
87 BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector)
89 #endif
91 #endif // BOOST_SERIALIZATION_STRING_HPP