#pragma once #include "../Global.h" #define VCMI_EDITOR_VERSION "0.1" #define VCMI_EDITOR_NAME "VCMI Map Editor" #include #include #include #include #include #include #include VCMI_LIB_USING_NAMESPACE using NumericPointer = typename std::conditional::type; template NumericPointer data_cast(Type * _pointer) { static_assert(sizeof(Type *) == sizeof(NumericPointer), "Cannot compile for that architecture, see NumericPointer definition"); return reinterpret_cast(_pointer); } template Type * data_cast(NumericPointer _numeric) { static_assert(sizeof(Type *) == sizeof(NumericPointer), "Cannot compile for that architecture, see NumericPointer definition"); return reinterpret_cast(_numeric); } inline QString pathToQString(const boost::filesystem::path & path) { #ifdef VCMI_WINDOWS return QString::fromStdWString(path.wstring()); #else return QString::fromStdString(path.string()); #endif } inline boost::filesystem::path qstringToPath(const QString & path) { #ifdef VCMI_WINDOWS return boost::filesystem::path(path.toStdWString()); #else return boost::filesystem::path(path.toUtf8().data()); #endif }