Make UndefinedGroupError::GetGroupName() const

Also move the constructor and function definitions out of the header
where they're declared.
This commit is contained in:
Oliver Hamlet
2023-01-06 22:20:34 +00:00
parent 57b397aed6
commit 10a9ba60e2
3 changed files with 37 additions and 4 deletions
+1
View File
@@ -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")
@@ -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_;
+34
View File
@@ -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
<https://www.gnu.org/licenses/>.
*/
#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_; }
}