Initial editbox version
[ttodo.git] / tde.cc
blob6c6ceb3a455092c8d60e4cf8af0698a9d81d108d
1 // tde.cc
2 //
4 #include "tde.h"
6 /// Default constructor.
7 CTodoEntry::CTodoEntry (void)
8 : m_Text (),
9 m_Comment (),
10 m_Created (0),
11 m_Done (0),
12 m_Id (0),
13 m_Parent (0),
14 m_Priority (priority_Medium),
15 m_State (0)
19 /// Reads the object from stream \p is.
20 void CTodoEntry::read (istream& is)
22 is >> m_Created >> m_Done
23 >> m_Id >> m_Parent >> m_Priority >> m_State
24 >> m_Text >> m_Comment >> ios::talign<time_t>();
27 /// Writes the object to stream \p os.
28 void CTodoEntry::write (ostream& os) const
30 os << m_Created << m_Done
31 << m_Id << m_Parent << m_Priority << m_State
32 << m_Text << m_Comment << ios::talign<time_t>();
35 /// Returns the size of the written object.
36 size_t CTodoEntry::stream_size (void) const
38 return (Align (stream_size_of (m_Created) +
39 stream_size_of (m_Done) +
40 stream_size_of (m_Id) +
41 stream_size_of (m_Parent) +
42 stream_size_of (m_Priority) +
43 stream_size_of (m_State) +
44 stream_size_of (m_Text) +
45 stream_size_of (m_Comment), alignof(m_Created)));