7 /// Default constructor.
8 CTodoEntry::CTodoEntry (void)
11 m_Created (time (NULL
)),
15 m_Priority (priority_Medium
),
20 /// Reads the object from stream \p is.
21 void CTodoEntry::read (istream
& is
)
23 is
>> m_Created
>> m_Done
24 >> m_Id
>> m_SublistId
>> m_Priority
>> m_Progress
25 >> m_Text
>> m_Comment
>> ios::talign
<time_t>();
28 /// Writes the object to stream \p os.
29 void CTodoEntry::write (ostream
& os
) const
31 os
<< m_Created
<< m_Done
32 << m_Id
<< m_SublistId
<< m_Priority
<< m_Progress
33 << m_Text
<< m_Comment
<< ios::talign
<time_t>();
36 /// Returns the size of the written object.
37 size_t CTodoEntry::stream_size (void) const
39 return (Align (stream_size_of (m_Created
) +
40 stream_size_of (m_Done
) +
41 stream_size_of (m_Id
) +
42 stream_size_of (m_SublistId
) +
43 stream_size_of (m_Priority
) +
44 stream_size_of (m_Progress
) +
45 stream_size_of (m_Text
) +
46 stream_size_of (m_Comment
), alignof(m_Created
)));
49 /// Marks the item's \p progress and sets the done time if appropriate.
50 void CTodoEntry::MarkComplete (uint8_t progress
)
52 assert (progress
<= 100 && "Progress field is a percentage");
53 m_Progress
= progress
;
55 if (m_Progress
!= 100)