epoc32/include/stdapis/boost/archive/basic_text_iarchive.hpp
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
#ifndef BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
williamr@2
     2
#define BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP
williamr@2
     3
williamr@2
     4
// MS compatible compilers support #pragma once
williamr@2
     5
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
williamr@2
     6
# pragma once
williamr@2
     7
#endif
williamr@2
     8
williamr@2
     9
/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
williamr@2
    10
// basic_text_iarchive.hpp
williamr@2
    11
williamr@2
    12
// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . 
williamr@2
    13
// Use, modification and distribution is subject to the Boost Software
williamr@2
    14
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
williamr@2
    15
// http://www.boost.org/LICENSE_1_0.txt)
williamr@2
    16
williamr@2
    17
//  See http://www.boost.org for updates, documentation, and revision history.
williamr@2
    18
williamr@2
    19
// archives stored as text - note these ar templated on the basic
williamr@2
    20
// stream templates to accommodate wide (and other?) kind of characters
williamr@2
    21
//
williamr@2
    22
// note the fact that on libraries without wide characters, ostream is
williamr@2
    23
// is not a specialization of basic_ostream which in fact is not defined
williamr@2
    24
// in such cases.   So we can't use basic_ostream<IStream::char_type> but rather
williamr@2
    25
// use two template parameters
williamr@2
    26
williamr@2
    27
#include <boost/config.hpp>
williamr@2
    28
#include <boost/pfto.hpp>
williamr@2
    29
#include <boost/detail/workaround.hpp>
williamr@2
    30
williamr@2
    31
#include <boost/archive/detail/common_iarchive.hpp>
williamr@2
    32
#include <boost/serialization/string.hpp>
williamr@2
    33
williamr@2
    34
#include <boost/archive/detail/abi_prefix.hpp> // must be the last header
williamr@2
    35
williamr@2
    36
namespace boost {
williamr@2
    37
namespace archive {
williamr@2
    38
williamr@2
    39
/////////////////////////////////////////////////////////////////////////
williamr@2
    40
// class basic_text_iarchive - read serialized objects from a input text stream
williamr@2
    41
template<class Archive>
williamr@2
    42
class basic_text_iarchive : 
williamr@2
    43
    public detail::common_iarchive<Archive>
williamr@2
    44
{
williamr@2
    45
protected:
williamr@2
    46
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
williamr@2
    47
public:
williamr@2
    48
#elif defined(BOOST_MSVC)
williamr@2
    49
    // for some inexplicable reason insertion of "class" generates compile erro
williamr@2
    50
    // on msvc 7.1
williamr@2
    51
    friend detail::interface_iarchive<Archive>;
williamr@2
    52
#else
williamr@2
    53
    friend class detail::interface_iarchive<Archive>;
williamr@2
    54
#endif
williamr@2
    55
    // intermediate level to support override of operators
williamr@2
    56
    // fot templates in the absence of partial function 
williamr@2
    57
    // template ordering
williamr@2
    58
    typedef detail::common_iarchive<Archive> detail_common_iarchive;
williamr@2
    59
    template<class T>
williamr@2
    60
    void load_override(T & t, BOOST_PFTO int)
williamr@2
    61
    {
williamr@2
    62
        this->detail_common_iarchive::load_override(t, 0);
williamr@2
    63
    }
williamr@2
    64
williamr@2
    65
    // Borland compilers has a problem with strong type.  Try to fix this here
williamr@2
    66
    #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
williamr@2
    67
    void load_override(version_type & t, int){ 
williamr@2
    68
        unsigned int x;
williamr@2
    69
        * this->This() >> x;
williamr@2
    70
        t.t = version_type(x);
williamr@2
    71
    }
williamr@2
    72
    #endif
williamr@2
    73
williamr@2
    74
    // text file don't include the optional information 
williamr@2
    75
    void load_override(class_id_optional_type & /*t*/, int){}
williamr@2
    76
williamr@2
    77
    BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
williamr@2
    78
    load_override(class_name_type & t, int);
williamr@2
    79
williamr@2
    80
    BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
williamr@2
    81
    init(void);
williamr@2
    82
williamr@2
    83
    basic_text_iarchive(unsigned int flags) : 
williamr@2
    84
        detail::common_iarchive<Archive>(flags)
williamr@2
    85
    {}
williamr@2
    86
    ~basic_text_iarchive(){}
williamr@2
    87
};
williamr@2
    88
williamr@2
    89
} // namespace archive
williamr@2
    90
} // namespace boost
williamr@2
    91
williamr@2
    92
#include <boost/archive/detail/abi_suffix.hpp> // pops abi_suffix.hpp pragmas
williamr@2
    93
williamr@2
    94
#endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP