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