Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class application_impl {
bfs::path _data_dir;

string _version;
uint64_t _version_int;
};

application::application()
Expand All @@ -38,10 +39,18 @@ void application::set_version(string version) {
my->_version = version;
}

void application::set_version(uint64_t version) {
my->_version_int = version;
}

string application::version() const {
return my->_version;
}

uint64_t application::version_int() const {
return my->_version_int;
}

void application::startup() {
for (auto plugin : initialized_plugins)
plugin->startup();
Expand Down
10 changes: 10 additions & 0 deletions include/appbase/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,21 @@ namespace appbase {
* @param version Version string output verbatim with -v/--version
*/
void set_version(string version);
/** @overload
*
* @param version Integer version independent of the string output with -v/--version
*/
void set_version(uint64_t version);
/** @brief Gets version string
*
* @return Version string output with -v/--version
*/
string version() const;
/** @brief Gets version integer
*
* @return Version integer independent of the string output with -v/--version
*/
uint64_t version_int() const;
/**
* @brief Looks for the --plugin commandline / config option and calls initialize on those plugins
*
Expand Down