diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-01-10 21:40:53 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:43 +0100 |
commit | 3f299a554ad9a7eea21f603027b3b3796aa883b0 (patch) | |
tree | f2f3a1f403b5292da30097b6e326f6e2227262be /src/base | |
parent | 55c4e615ea3fca7cb5f32932c3345590d77facce (diff) | |
download | usdx-3f299a554ad9a7eea21f603027b3b3796aa883b0.tar.gz usdx-3f299a554ad9a7eea21f603027b3b3796aa883b0.tar.xz usdx-3f299a554ad9a7eea21f603027b3b3796aa883b0.zip |
added doxygen comments
Diffstat (limited to 'src/base')
-rw-r--r-- | src/base/database.hpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/base/database.hpp b/src/base/database.hpp index 0c4b65d6..8e589feb 100644 --- a/src/base/database.hpp +++ b/src/base/database.hpp @@ -43,7 +43,15 @@ namespace usdx private: static log4cxx::LoggerPtr log; + /** + * Filename of the opened statistic database. + */ std::string filename; + + /** + * Internal reference to the sqlite database handle of the open + * sqlite database. + */ sqlite3 *database; // Singleton @@ -64,6 +72,12 @@ namespace usdx ~StatDatabase(void); + /** + * Opens a sqlite3 database from the given path and initializes + * that class by saving a reference to the open database handle. + * + * @param filename Filename of a database to open. + */ static void init(const std::string filename); /* void read_score(Song *song); @@ -75,7 +89,26 @@ namespace usdx StatResult* get_stats(StatResult *list, short count, unsigned int page, bool reversed); // unsigned int get_total_entrys(StatType type); + /** + * Get the timestamp of the last reset of the database. + * + * @return Timestamp + */ time_t get_stat_reset(void); + + /** + * Convert a timestamp to a data representation in a string. + * + * @param time Pointer to a char buffer that will contain the + * the date string. + * @param max Maximum bytes that could be written to the buffer. + * @param timestamp Timestamp to convert to the string. + * @return Pointer to the buffer supplied as first parameter, + * containing: + * - only a '\\0' at first position if timestamp was + * 0 or if max was to short to contain the date + * - the date string with the terminating '\\0' + */ char* format_date(char* time, size_t max, time_t timestamp); }; |