7 /// Default constructor.
8 CTodoEntry::CTodoEntry (void)
16 m_Priority (priority_Medium
),
19 const time_t now (time (NULL
));
20 m_Created
= uint32_t(now
);
24 /// Reads the object from stream \p is.
25 void CTodoEntry::read (istream
& is
)
27 is
>> m_Epoch
>> m_Created
>> m_Done
28 >> m_Id
>> m_SublistId
>> m_Priority
>> m_Progress
29 >> m_Text
>> m_Comment
>> ios::align(4);
32 /// Writes the object to stream \p os.
33 void CTodoEntry::write (ostream
& os
) const
35 os
<< m_Epoch
<< m_Created
<< m_Done
36 << m_Id
<< m_SublistId
<< m_Priority
<< m_Progress
37 << m_Text
<< m_Comment
<< ios::align(4);
40 /// Returns the size of the written object.
41 size_t CTodoEntry::stream_size (void) const
43 return (Align (stream_size_of (m_Epoch
) +
44 stream_size_of (m_Created
) +
45 stream_size_of (m_Done
) +
46 stream_size_of (m_Id
) +
47 stream_size_of (m_SublistId
) +
48 stream_size_of (m_Priority
) +
49 stream_size_of (m_Progress
) +
50 stream_size_of (m_Text
) +
51 stream_size_of (m_Comment
), 4));
54 /// Marks the item's \p progress and sets the done time if appropriate.
55 void CTodoEntry::MarkComplete (uint8_t progress
)
57 assert (progress
<= 100 && "Progress field is a percentage");
58 m_Progress
= progress
;
60 if (m_Progress
!= 100)
64 /// Returns text string containing the combined date.
65 const char* CTodoEntry::TimeTText (uint32_t v
) const
67 time_t t (MakeTimeT (v
));