Remove some unnecessary includes

This commit is contained in:
Oliver Hamlet
2025-03-15 14:17:40 +00:00
parent a54ae366a3
commit 1748dc7a3c
11 changed files with 21 additions and 78 deletions
-1
View File
@@ -279,7 +279,6 @@ set(LIBLOOT_SRC_API_H_FILES
"${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_sort.h"
"${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_graph.h"
"${CMAKE_SOURCE_DIR}/src/api/sorting/plugin_sorting_data.h"
"${CMAKE_SOURCE_DIR}/src/api/helpers/collections.h"
"${CMAKE_SOURCE_DIR}/src/api/helpers/crc.h"
"${CMAKE_SOURCE_DIR}/src/api/helpers/logging.h"
"${CMAKE_SOURCE_DIR}/src/api/helpers/text.h")
-50
View File
@@ -1,50 +0,0 @@
/* LOOT
A load order optimisation tool for Oblivion, Skyrim, Fallout 3 and
Fallout: New Vegas.
Copyright (C) 2012-2016 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/>.
*/
#ifndef LOOT_API_HELPERS_COLLECTIONS
#define LOOT_API_HELPERS_COLLECTIONS
#include <vector>
namespace loot {
// Append second to first, skipping any elements that are already present in
// first. Although this is O(U * M), both input vectors are expected to be
// small (with tens of elements being an unusually large number).
template<typename T>
std::vector<T> mergeVectors(std::vector<T> first,
const std::vector<T>& second) {
const auto initialSizeOfFirst = first.size();
for (const auto& element : second) {
const auto end = first.cbegin() + initialSizeOfFirst;
if (std::find(first.cbegin(), end, element) == end) {
first.push_back(element);
}
}
return first;
}
}
#endif
@@ -24,10 +24,6 @@
#include "loot/metadata/conditional_metadata.h"
#include "api/game/game.h"
#include "api/helpers/logging.h"
#include "api/metadata/condition_evaluator.h"
namespace loot {
ConditionalMetadata::ConditionalMetadata(const std::string& condition) :
condition_(condition) {}
-3
View File
@@ -24,9 +24,6 @@
#include "loot/metadata/file.h"
#include "api/helpers/text.h"
#include "api/metadata/yaml/file.h"
namespace loot {
File::File(const std::string& name,
const std::string& display,
-2
View File
@@ -24,8 +24,6 @@
#include "loot/metadata/group.h"
#include "api/metadata/yaml/group.h"
namespace loot {
Group::Group(const std::string& name,
const std::vector<std::string>& afterGroups,
+1 -3
View File
@@ -24,9 +24,7 @@
#include "loot/metadata/message.h"
#include <boost/algorithm/string.hpp>
#include "api/game/game.h"
#include <stdexcept>
namespace loot {
Message::Message(const MessageType type,
-3
View File
@@ -24,9 +24,6 @@
#include "loot/metadata/message_content.h"
#include <boost/algorithm/string.hpp>
#include <optional>
namespace loot {
MessageContent::MessageContent(const std::string& text,
const std::string& language) :
@@ -24,10 +24,6 @@
#include "loot/metadata/plugin_cleaning_data.h"
#include "api/game/game.h"
#include "api/helpers/crc.h"
#include "api/helpers/logging.h"
namespace loot {
PluginCleaningData::PluginCleaningData(uint32_t crc,
const std::string& utility) :
+20 -4
View File
@@ -24,15 +24,31 @@
#include "loot/metadata/plugin_metadata.h"
#include <boost/algorithm/string.hpp>
#include <regex>
#include "api/game/game.h"
#include "api/helpers/collections.h"
#include "api/helpers/logging.h"
#include "api/helpers/text.h"
#include "api/metadata/yaml/plugin_metadata.h"
namespace {
// Append second to first, skipping any elements that are already present in
// first. Although this is O(U * M), both input vectors are expected to be
// small (with tens of elements being an unusually large number).
template<typename T>
std::vector<T> mergeVectors(std::vector<T> first,
const std::vector<T>& second) {
const auto initialSizeOfFirst = first.size();
for (const auto& element : second) {
const auto end = first.cbegin() + initialSizeOfFirst;
if (std::find(first.cbegin(), end, element) == end) {
first.push_back(element);
}
}
return first;
}
}
namespace loot {
PluginMetadata::PluginMetadata(const std::string& n) : name_(n) {
// If the name passed ends in '.ghost', that should be trimmed.
-2
View File
@@ -24,8 +24,6 @@
#include "loot/metadata/tag.h"
#include <boost/algorithm/string.hpp>
namespace loot {
Tag::Tag(const std::string& tag,
const bool isAddition,
@@ -23,8 +23,6 @@
*/
#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"),