source: NonGTP/Boost/boost/archive/impl/basic_text_oarchive.ipp @ 857

Revision 857, 1.7 KB checked in by igarcia, 19 years ago (diff)
Line 
1/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
2// basic_text_oarchive.ipp:
3
4// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
5// Use, modification and distribution is subject to the Boost Software
6// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8
9//  See http://www.boost.org for updates, documentation, and revision history.
10#include <string>
11#include <cassert>
12#include <cstring>
13
14#include <boost/config.hpp> // for BOOST_DEDUCED_TYPENAME
15#if defined(BOOST_NO_STDC_NAMESPACE)
16namespace std{
17    using ::memcpy;
18}
19#endif
20
21#include <boost/archive/basic_text_oarchive.hpp>
22
23namespace boost {
24namespace archive {
25
26/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
27// implementation of basic_text_oarchive
28
29template<class Archive>
30BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
31basic_text_oarchive<Archive>::newtoken()
32{
33    switch(delimiter){
34    default:
35        assert(false);
36        break;
37    case eol:
38        this->This()->put('\n');
39        delimiter = space;
40        break;
41    case space:
42        this->This()->put(' ');
43        break;
44    case none:
45        delimiter = space;
46        break;
47    }
48}
49
50template<class Archive>
51BOOST_ARCHIVE_OR_WARCHIVE_DECL(void)
52basic_text_oarchive<Archive>::init(){
53    // write signature in an archive version independent manner
54    const std::string file_signature(ARCHIVE_SIGNATURE());
55    * this->This() << file_signature;
56    // write library version
57    const version_type v(ARCHIVE_VERSION());
58    * this->This() << v;
59}
60
61} // namespace archive
62} // namespace boost
Note: See TracBrowser for help on using the repository browser.