Move LootVersion class to API includes folder

Ready for inclusion into the C++ API: it will replace the
loot_get_version() and loot_get_build_id() functions.
This commit is contained in:
Oliver Hamlet
2016-08-24 08:08:02 +01:00
parent c29b5b7d50
commit 05059d36af
9 changed files with 41 additions and 22 deletions
+5 -1
View File
@@ -180,7 +180,6 @@ set (LOOT_SRC "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.cpp"
set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.h"
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_settings.h"
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_state.h"
"${CMAKE_SOURCE_DIR}/src/backend/app/loot_version.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_evaluator.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/condition_grammar.h"
"${CMAKE_SOURCE_DIR}/src/backend/metadata/conditional_metadata.h"
@@ -209,6 +208,7 @@ set (LOOT_HEADERS "${CMAKE_SOURCE_DIR}/src/backend/app/loot_paths.h"
"${CMAKE_SOURCE_DIR}/src/backend/error.h"
"${CMAKE_SOURCE_DIR}/include/loot/game_type.h"
"${CMAKE_SOURCE_DIR}/include/loot/language_code.h"
"${CMAKE_SOURCE_DIR}/include/loot/loot_version.h"
"${CMAKE_SOURCE_DIR}/include/loot/message_type.h")
set (LOOT_GUI_SRC "${CMAKE_SOURCE_DIR}/src/gui/main.cpp"
@@ -419,6 +419,10 @@ ENDIF ()
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
set_target_properties (loot_common PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
set_target_properties (tests PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
set_target_properties (LOOT PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
set_target_properties (metadata-validator PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_STATIC")
IF (BUILD_SHARED_LIBS)
set_target_properties (loot_api PROPERTIES COMPILE_DEFINITIONS "${COMPILE_DEFINITIONS} LOOT_EXPORT")
ELSE ()
@@ -22,20 +22,36 @@ along with LOOT. If not, see
<https://www.gnu.org/licenses/>.
*/
#ifndef LOOT_BACKEND_APP_LOOT_VERSION
#define LOOT_BACKEND_APP_LOOT_VERSION
#ifndef LOOT_LOOT_VERSION
#define LOOT_LOOT_VERSION
#include <string>
/* set up dll import/export decorators
when compiling the dll on windows, ensure LOOT_EXPORT is defined. clients
that use this header do not need to define anything to import the symbols
properly. */
#if defined(_WIN32)
# ifdef LOOT_STATIC
# define LOOT_API
# elif defined LOOT_EXPORT
# define LOOT_API __declspec(dllexport)
# else
# define LOOT_API __declspec(dllimport)
# endif
#else
# define LOOT_API
#endif
namespace loot {
class LootVersion {
public:
static const unsigned int major;
static const unsigned int minor;
static const unsigned int patch;
static const std::string revision;
LOOT_API static const unsigned int major;
LOOT_API static const unsigned int minor;
LOOT_API static const unsigned int patch;
LOOT_API static const std::string revision;
static std::string string();
LOOT_API static std::string string();
};
}
-1
View File
@@ -28,7 +28,6 @@
#include <boost/filesystem/fstream.hpp>
#include "backend/app/loot_version.h"
#include "loot/loot_version.h"
using std::lock_guard;
+1 -1
View File
@@ -36,9 +36,9 @@
#include "backend/error.h"
#include "backend/app/loot_paths.h"
#include "backend/app/loot_version.h"
#include "backend/helpers/helpers.h"
#include "backend/helpers/language.h"
#include "loot/loot_version.h"
#ifdef _WIN32
#include <windows.h>
+8 -8
View File
@@ -22,15 +22,15 @@
<https://www.gnu.org/licenses/>.
*/
#include "backend/app/loot_version.h"
#include "loot/loot_version.h"
namespace loot {
const unsigned int LootVersion::major = 0;
const unsigned int LootVersion::minor = 9;
const unsigned int LootVersion::patch = 2;
const std::string LootVersion::revision = "@GIT_COMMIT_STRING@";
const unsigned int LootVersion::major = 0;
const unsigned int LootVersion::minor = 9;
const unsigned int LootVersion::patch = 2;
const std::string LootVersion::revision = "@GIT_COMMIT_STRING@";
std::string LootVersion::string() {
return std::to_string(major) + '.' + std::to_string(minor) + '.' + std::to_string(patch);
}
LOOT_API std::string LootVersion::string() {
return std::to_string(major) + '.' + std::to_string(minor) + '.' + std::to_string(patch);
}
}
+1 -1
View File
@@ -43,11 +43,11 @@
#include "backend/error.h"
#include "backend/app/loot_paths.h"
#include "backend/app/loot_version.h"
#include "backend/plugin/plugin_sorter.h"
#include "backend/helpers/helpers.h"
#include "backend/helpers/json.h"
#include "backend/helpers/version.h"
#include "loot/loot_version.h"
using boost::filesystem::exists;
using boost::format;
+1 -1
View File
@@ -29,7 +29,7 @@ along with LOOT. If not, see
#include <gtest/gtest.h>
#include "backend/app/loot_version.h"
#include "loot/loot_version.h"
namespace loot {
namespace test {
+1 -1
View File
@@ -25,8 +25,8 @@ along with LOOT. If not, see
#ifndef LOOT_TESTS_BACKEND_HELPERS_VERSION_TEST
#define LOOT_TESTS_BACKEND_HELPERS_VERSION_TEST
#include "backend/app/loot_version.h"
#include "backend/helpers/version.h"
#include "loot/loot_version.h"
#include <gtest/gtest.h>
+1 -1
View File
@@ -24,7 +24,7 @@
#include <boost/log/core.hpp>
#include "backend/app/loot_version.h"
#include "loot/loot_version.h"
#include "backend/metadata_list.h"
int main(int argc, char **argv) {