diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-30 18:06:37 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-30 18:06:37 -0400 |
commit | a757b19f51ac7aa120e6829b573187b1ff36301a (patch) | |
tree | 5e6d4ef278f3f9915713f958979a4c35a53378fb /src/item.h | |
parent | 1b8811f997568d8aede86197a36fc65586996494 (diff) | |
download | fork-ledger-a757b19f51ac7aa120e6829b573187b1ff36301a.tar.gz fork-ledger-a757b19f51ac7aa120e6829b573187b1ff36301a.tar.bz2 fork-ledger-a757b19f51ac7aa120e6829b573187b1ff36301a.zip |
Added serialization methods for most type
This allows journal_t objects to be completed serialized to disk and
deserialized.
Diffstat (limited to 'src/item.h')
-rw-r--r-- | src/item.h | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -79,6 +79,22 @@ struct position_t } return *this; } + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & pathname; + ar & beg_pos; + ar & beg_line; + ar & end_pos; + ar & end_line; + } +#endif // HAVE_BOOST_SERIALIZATION }; /** @@ -176,6 +192,25 @@ public: virtual expr_t::ptr_op_t lookup(const string& name); bool valid() const; + +#if defined(HAVE_BOOST_SERIALIZATION) +private: + /** Serialization. */ + + friend class boost::serialization::access; + + template<class Archive> + void serialize(Archive & ar, const unsigned int /* version */) { + ar & boost::serialization::base_object<supports_flags<> >(*this); + ar & boost::serialization::base_object<scope_t>(*this); + ar & _state; + ar & _date; + ar & _date_eff; + ar & note; + ar & metadata; + ar & pos; + } +#endif // HAVE_BOOST_SERIALIZATION }; value_t get_comment(item_t& item); |