summaryrefslogtreecommitdiff
path: root/src/item.h
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-10-30 18:06:37 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-10-30 18:06:37 -0400
commita757b19f51ac7aa120e6829b573187b1ff36301a (patch)
tree5e6d4ef278f3f9915713f958979a4c35a53378fb /src/item.h
parent1b8811f997568d8aede86197a36fc65586996494 (diff)
downloadfork-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.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/item.h b/src/item.h
index e8acb0e2..5518a063 100644
--- a/src/item.h
+++ b/src/item.h
@@ -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);