diff --git a/CMakeLists.txt b/CMakeLists.txt index 93ab9b9a..fb30298b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -193,6 +193,7 @@ set(LIBLOOT_SRC_API_CPP_FILES "${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_sort.cpp" "${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_graph.cpp" "${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_sorting_data.cpp" + "${CMAKE_SOURCE_DIR}/src/api/sorting/undefined_group_error.cpp" "${CMAKE_SOURCE_DIR}/src/api/helpers/crc.cpp" "${CMAKE_SOURCE_DIR}/src/api/helpers/text.cpp" "${CMAKE_SOURCE_DIR}/src/api/vertex.cpp") diff --git a/include/loot/exception/undefined_group_error.h b/include/loot/exception/undefined_group_error.h index 6ba6ae86..008b3ae0 100644 --- a/include/loot/exception/undefined_group_error.h +++ b/include/loot/exception/undefined_group_error.h @@ -39,15 +39,13 @@ public: * @brief Construct an exception for an undefined group. * @param groupName The name of the group that is undefined. */ - LOOT_API UndefinedGroupError(const std::string& groupName) : - std::runtime_error("The group \"" + groupName + "\" does not exist"), - groupName_(groupName) {} + LOOT_API UndefinedGroupError(const std::string& groupName); /** * Get the name of the undefined group. * @return A group name. */ - LOOT_API std::string GetGroupName() { return groupName_; } + LOOT_API std::string GetGroupName() const; private: std::string groupName_; diff --git a/src/api/sorting/undefined_group_error.cpp b/src/api/sorting/undefined_group_error.cpp new file mode 100644 index 00000000..293ac857 --- /dev/null +++ b/src/api/sorting/undefined_group_error.cpp @@ -0,0 +1,34 @@ +/* LOOT + + A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and + Fallout: New Vegas. + + Copyright (C) 2018 WrinklyNinja + + This file is part of LOOT. + + LOOT is free software: you can redistribute + it and/or modify it under the terms of the GNU General Public License + as published by the Free Software Foundation, either version 3 of + the License, or (at your option) any later version. + + LOOT is distributed in the hope that it will + be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LOOT. If not, see + . + */ +#include "loot/exception/undefined_group_error.h" + +#include "api/sorting/plugin_graph.h" + +namespace loot { +UndefinedGroupError::UndefinedGroupError(const std::string& groupName) : + std::runtime_error("The group \"" + groupName + "\" does not exist"), + groupName_(groupName) {} + +std::string UndefinedGroupError::GetGroupName() const { return groupName_; } +}