1a1c3daa6SAndrew Lindesay /* 2*f0e491d3SAndrew Lindesay * Copyright 2017-2020, Andrew Lindesay <apl@lindesay.co.nz>. 3a1c3daa6SAndrew Lindesay * All rights reserved. Distributed under the terms of the MIT License. 4a1c3daa6SAndrew Lindesay */ 5a1c3daa6SAndrew Lindesay #ifndef STANDARD_META_DATA_H 6a1c3daa6SAndrew Lindesay #define STANDARD_META_DATA_H 7a1c3daa6SAndrew Lindesay 8a1c3daa6SAndrew Lindesay #include <DateTime.h> 9a1c3daa6SAndrew Lindesay #include <File.h> 10a1c3daa6SAndrew Lindesay #include <HttpHeaders.h> 11a1c3daa6SAndrew Lindesay #include <Locker.h> 12a1c3daa6SAndrew Lindesay #include <String.h> 13a1c3daa6SAndrew Lindesay 14a1c3daa6SAndrew Lindesay 15a1c3daa6SAndrew Lindesay /* This class models (some of) the meta-data that is bundled into data that is 16a1c3daa6SAndrew Lindesay * relayed from the HaikuDepotServer application server down to the client. 17a1c3daa6SAndrew Lindesay * This includes the tar-ball of icons as well as "bulk data" such as streams of 18a1c3daa6SAndrew Lindesay * information about repositories and packages. 19a1c3daa6SAndrew Lindesay */ 20a1c3daa6SAndrew Lindesay 21a1c3daa6SAndrew Lindesay 22a1c3daa6SAndrew Lindesay class StandardMetaData { 23a1c3daa6SAndrew Lindesay public: 24a1c3daa6SAndrew Lindesay StandardMetaData(); 25a1c3daa6SAndrew Lindesay 26*f0e491d3SAndrew Lindesay uint64_t GetCreateTimestamp() const; 27*f0e491d3SAndrew Lindesay BDateTime GetCreateTimestampAsDateTime() const; 28a1c3daa6SAndrew Lindesay void SetCreateTimestamp(uint64_t value); 29a1c3daa6SAndrew Lindesay 30*f0e491d3SAndrew Lindesay uint64_t GetDataModifiedTimestamp() const; 31*f0e491d3SAndrew Lindesay BDateTime GetDataModifiedTimestampAsDateTime() 32*f0e491d3SAndrew Lindesay const; 33a1c3daa6SAndrew Lindesay void SetDataModifiedTimestamp( 34a1c3daa6SAndrew Lindesay uint64_t value); 35a1c3daa6SAndrew Lindesay 36*f0e491d3SAndrew Lindesay bool IsPopulated() const; 37a1c3daa6SAndrew Lindesay private: 38*f0e491d3SAndrew Lindesay static BDateTime _CreateDateTime( 39a1c3daa6SAndrew Lindesay uint64_t millisSinceEpoc); 40*f0e491d3SAndrew Lindesay 41*f0e491d3SAndrew Lindesay private: 42a1c3daa6SAndrew Lindesay uint64_t fCreateTimestamp; 43a1c3daa6SAndrew Lindesay uint64_t fDataModifiedTimestamp; 44a1c3daa6SAndrew Lindesay }; 45a1c3daa6SAndrew Lindesay 46a1c3daa6SAndrew Lindesay 47a1c3daa6SAndrew Lindesay #endif // STANDARD_META_DATA_H 48