2 * Copyright 2017, Andrew Lindesay <apl@lindesay.co.nz>.
3 * All rights reserved. Distributed under the terms of the MIT License.
6 #include "StandardMetaData.h"
8 StandardMetaData::StandardMetaData()
11 fDataModifiedTimestamp
= 0;
16 StandardMetaData::_CreateDateTime(uint64_t millisSinceEpoc
)
18 time_t secondsSinceEpoc
= (millisSinceEpoc
/ 1000);
20 result
.SetTime_t(secondsSinceEpoc
);
26 StandardMetaData::GetCreateTimestamp()
28 return fCreateTimestamp
;
33 StandardMetaData::GetCreateTimestampAsDateTime()
35 return _CreateDateTime(GetCreateTimestamp());
40 StandardMetaData::SetCreateTimestamp(uint64_t value
)
42 fCreateTimestamp
= value
;
47 StandardMetaData::GetDataModifiedTimestamp()
49 return fDataModifiedTimestamp
;
54 StandardMetaData::SetDataModifiedTimestamp(uint64_t value
)
56 fDataModifiedTimestamp
= value
;
61 StandardMetaData::GetDataModifiedTimestampAsDateTime()
63 return _CreateDateTime(GetDataModifiedTimestamp());
68 StandardMetaData::IsPopulated()
70 return fCreateTimestamp
!= 0 && fDataModifiedTimestamp
!= 0;