os/ossrv/ossrv_pub/boost_apis/boost/serialization/string.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200 (2014-06-10)
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
#ifndef  BOOST_SERIALIZATION_STRING_HPP
sl@0
     2
#define BOOST_SERIALIZATION_STRING_HPP
sl@0
     3
sl@0
     4
// MS compatible compilers support #pragma once
sl@0
     5
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
sl@0
     6
# pragma once
sl@0
     7
#endif
sl@0
     8
sl@0
     9
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
sl@0
    10
// serialization/string.hpp:
sl@0
    11
// serialization for stl string templates
sl@0
    12
sl@0
    13
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 
sl@0
    14
// Use, modification and distribution is subject to the Boost Software
sl@0
    15
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
sl@0
    16
// http://www.boost.org/LICENSE_1_0.txt)
sl@0
    17
sl@0
    18
//  See http://www.boost.org for updates, documentation, and revision history.
sl@0
    19
sl@0
    20
#include <string>
sl@0
    21
sl@0
    22
#include <boost/config.hpp>
sl@0
    23
#include <boost/serialization/level.hpp>
sl@0
    24
sl@0
    25
BOOST_CLASS_IMPLEMENTATION(std::string, boost::serialization::primitive_type)
sl@0
    26
#ifndef BOOST_NO_STD_WSTRING
sl@0
    27
BOOST_CLASS_IMPLEMENTATION(std::wstring, boost::serialization::primitive_type)
sl@0
    28
#endif
sl@0
    29
sl@0
    30
// left over from a previous incarnation - strings are now always primitive types
sl@0
    31
#if 0 
sl@0
    32
#include <string>
sl@0
    33
#include <boost/serialization/collections_save_imp.hpp>
sl@0
    34
#include <boost/serialization/collections_load_imp.hpp>
sl@0
    35
#include <boost/serialization/split_free.hpp>
sl@0
    36
sl@0
    37
namespace boost { 
sl@0
    38
namespace serialization {
sl@0
    39
sl@0
    40
// basic_string - general case
sl@0
    41
template<class Archive, class U, class Allocator>
sl@0
    42
inline void save(
sl@0
    43
    Archive & ar,
sl@0
    44
    const std::basic_string<U, Allocator> &t,
sl@0
    45
    const unsigned int file_version
sl@0
    46
){
sl@0
    47
    boost::serialization::stl::save_collection<
sl@0
    48
        Archive, std::basic_string<U, Allocator> 
sl@0
    49
    >(ar, t);
sl@0
    50
}
sl@0
    51
sl@0
    52
template<class Archive, class U, class Allocator>
sl@0
    53
inline void load(
sl@0
    54
    Archive & ar,
sl@0
    55
    std::basic_string<U, Allocator> &t,
sl@0
    56
    const unsigned int file_version
sl@0
    57
){
sl@0
    58
    boost::serialization::stl::load_collection<
sl@0
    59
        Archive,
sl@0
    60
        std::basic_string<U, Allocator>,
sl@0
    61
        boost::serialization::stl::archive_input_seq<
sl@0
    62
            Archive, 
sl@0
    63
            std::basic_string<U, Allocator> 
sl@0
    64
        >,
sl@0
    65
        boost::serialization::stl::reserve_imp<
sl@0
    66
            std::basic_string<U, Allocator> 
sl@0
    67
        >
sl@0
    68
    >(ar, t);
sl@0
    69
}
sl@0
    70
sl@0
    71
// split non-intrusive serialization function member into separate
sl@0
    72
// non intrusive save/load member functions
sl@0
    73
template<class Archive, class U, class Allocator>
sl@0
    74
inline void serialize(
sl@0
    75
    Archive & ar,
sl@0
    76
    std::basic_string<U, Allocator> & t,
sl@0
    77
    const unsigned int file_version
sl@0
    78
){
sl@0
    79
    boost::serialization::split_free(ar, t, file_version);
sl@0
    80
}
sl@0
    81
sl@0
    82
} // serialization
sl@0
    83
} // namespace boost
sl@0
    84
sl@0
    85
#include <boost/serialization/collection_traits.hpp>
sl@0
    86
sl@0
    87
BOOST_SERIALIZATION_COLLECTION_TRAITS(std::vector)
sl@0
    88
sl@0
    89
#endif
sl@0
    90
sl@0
    91
#endif // BOOST_SERIALIZATION_STRING_HPP