diff --git a/apps/bsatool/bsatool.cpp b/apps/bsatool/bsatool.cpp index a8e28fcfb3..c02c64356f 100644 --- a/apps/bsatool/bsatool.cpp +++ b/apps/bsatool/bsatool.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #define BSATOOL_VERSION 1.1 diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index 9d90a542be..9b81494956 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include "record.hpp" #include "labels.hpp" diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index 405aeb9454..9bb8ebb163 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -13,7 +13,7 @@ #include #include -#include +#include std::string bodyPartLabel(int idx) { diff --git a/apps/esmtool/record.cpp b/apps/esmtool/record.cpp index fbda7eee6b..43cd70accd 100644 --- a/apps/esmtool/record.cpp +++ b/apps/esmtool/record.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include namespace { diff --git a/apps/essimporter/convertacdt.cpp b/apps/essimporter/convertacdt.cpp index 17845a8513..0ebf7b6817 100644 --- a/apps/essimporter/convertacdt.cpp +++ b/apps/essimporter/convertacdt.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include "convertacdt.hpp" diff --git a/apps/essimporter/converter.hpp b/apps/essimporter/converter.hpp index f732143443..59ba0ebddb 100644 --- a/apps/essimporter/converter.hpp +++ b/apps/essimporter/converter.hpp @@ -24,6 +24,8 @@ #include #include +#include + #include "importcrec.hpp" #include "importcntc.hpp" diff --git a/apps/essimporter/convertinventory.cpp b/apps/essimporter/convertinventory.cpp index 79e09488c7..002cb4a4cf 100644 --- a/apps/essimporter/convertinventory.cpp +++ b/apps/essimporter/convertinventory.cpp @@ -1,6 +1,7 @@ #include "convertinventory.hpp" -#include +#include + #include namespace ESSImport diff --git a/apps/essimporter/convertplayer.cpp b/apps/essimporter/convertplayer.cpp index e80712d6c9..34dac06fab 100644 --- a/apps/essimporter/convertplayer.cpp +++ b/apps/essimporter/convertplayer.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include namespace ESSImport { diff --git a/apps/essimporter/convertscpt.cpp b/apps/essimporter/convertscpt.cpp index cb7947e400..45cc24db1f 100644 --- a/apps/essimporter/convertscpt.cpp +++ b/apps/essimporter/convertscpt.cpp @@ -1,9 +1,9 @@ #include "convertscpt.hpp" -#include - #include "convertscri.hpp" +#include + namespace ESSImport { diff --git a/apps/mwiniimporter/importer.cpp b/apps/mwiniimporter/importer.cpp index f7523b11cf..8e9d992d6d 100644 --- a/apps/mwiniimporter/importer.cpp +++ b/apps/mwiniimporter/importer.cpp @@ -1,7 +1,9 @@ #include "importer.hpp" #include -#include +#include +#include +#include #include #include diff --git a/apps/navmeshtool/worldspacedata.cpp b/apps/navmeshtool/worldspacedata.cpp index e93b50842c..be9a0df084 100644 --- a/apps/navmeshtool/worldspacedata.cpp +++ b/apps/navmeshtool/worldspacedata.cpp @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/apps/niftest/niftest.cpp b/apps/niftest/niftest.cpp index 219956cd75..67d33c6b9d 100644 --- a/apps/niftest/niftest.cpp +++ b/apps/niftest/niftest.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/opencs/model/doc/blacklist.cpp b/apps/opencs/model/doc/blacklist.cpp index 690d79983a..49db56f7f4 100644 --- a/apps/opencs/model/doc/blacklist.cpp +++ b/apps/opencs/model/doc/blacklist.cpp @@ -2,7 +2,7 @@ #include -#include +#include bool CSMDoc::Blacklist::isBlacklisted (const CSMWorld::UniversalId& id) const { diff --git a/apps/opencs/model/filter/parser.cpp b/apps/opencs/model/filter/parser.cpp index d02205d596..8aa8609059 100644 --- a/apps/opencs/model/filter/parser.cpp +++ b/apps/opencs/model/filter/parser.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "../world/columns.hpp" #include "../world/data.hpp" diff --git a/apps/opencs/model/tools/mergestages.cpp b/apps/opencs/model/tools/mergestages.cpp index 9b24f6ccf9..049ec1b1eb 100644 --- a/apps/opencs/model/tools/mergestages.cpp +++ b/apps/opencs/model/tools/mergestages.cpp @@ -1,6 +1,6 @@ #include "mergestages.hpp" -#include +#include #include "mergestate.hpp" diff --git a/apps/opencs/model/tools/referenceablecheck.cpp b/apps/opencs/model/tools/referenceablecheck.cpp index 981e8c1957..3816d1a0a4 100644 --- a/apps/opencs/model/tools/referenceablecheck.cpp +++ b/apps/opencs/model/tools/referenceablecheck.cpp @@ -1,6 +1,6 @@ #include "referenceablecheck.hpp" -#include +#include #include #include "../prefs/state.hpp" diff --git a/apps/opencs/model/tools/startscriptcheck.cpp b/apps/opencs/model/tools/startscriptcheck.cpp index deb7d384fc..0dc8f9771d 100644 --- a/apps/opencs/model/tools/startscriptcheck.cpp +++ b/apps/opencs/model/tools/startscriptcheck.cpp @@ -2,7 +2,7 @@ #include "../prefs/state.hpp" -#include +#include CSMTools::StartScriptCheckStage::StartScriptCheckStage ( const CSMWorld::IdCollection& startScripts, diff --git a/apps/opencs/model/world/collection.hpp b/apps/opencs/model/world/collection.hpp index 859866058c..7901655245 100644 --- a/apps/opencs/model/world/collection.hpp +++ b/apps/opencs/model/world/collection.hpp @@ -13,7 +13,7 @@ #include -#include +#include #include "columnbase.hpp" #include "collectionbase.hpp" diff --git a/apps/opencs/model/world/columns.cpp b/apps/opencs/model/world/columns.cpp index f61ae986d5..fef5d99659 100644 --- a/apps/opencs/model/world/columns.cpp +++ b/apps/opencs/model/world/columns.cpp @@ -1,7 +1,7 @@ #include "columns.hpp" #include -#include +#include #include "universalid.hpp" #include "infoselectwrapper.hpp" diff --git a/apps/opencs/model/world/commanddispatcher.cpp b/apps/opencs/model/world/commanddispatcher.cpp index dc815f43f3..96b8ac6297 100644 --- a/apps/opencs/model/world/commanddispatcher.cpp +++ b/apps/opencs/model/world/commanddispatcher.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include "../doc/document.hpp" diff --git a/apps/opencs/model/world/commands.cpp b/apps/opencs/model/world/commands.cpp index a264ebef7f..cbb637e8cb 100644 --- a/apps/opencs/model/world/commands.cpp +++ b/apps/opencs/model/world/commands.cpp @@ -4,8 +4,6 @@ #include #include -#include - #include #include diff --git a/apps/opencs/model/world/idtable.cpp b/apps/opencs/model/world/idtable.cpp index 51cd6522e7..61315459ac 100644 --- a/apps/opencs/model/world/idtable.cpp +++ b/apps/opencs/model/world/idtable.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "collectionbase.hpp" #include "columnbase.hpp" diff --git a/apps/opencs/model/world/infocollection.cpp b/apps/opencs/model/world/infocollection.cpp index 8ff11009b1..0fc572e46f 100644 --- a/apps/opencs/model/world/infocollection.cpp +++ b/apps/opencs/model/world/infocollection.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace CSMWorld { diff --git a/apps/opencs/model/world/infotableproxymodel.cpp b/apps/opencs/model/world/infotableproxymodel.cpp index 7c6a9c323e..e6d024311e 100644 --- a/apps/opencs/model/world/infotableproxymodel.cpp +++ b/apps/opencs/model/world/infotableproxymodel.cpp @@ -1,6 +1,6 @@ #include "infotableproxymodel.hpp" -#include +#include #include "idtablebase.hpp" #include "columns.hpp" diff --git a/apps/opencs/model/world/refiddata.cpp b/apps/opencs/model/world/refiddata.cpp index 3bd8bfd5fc..009e43706f 100644 --- a/apps/opencs/model/world/refiddata.cpp +++ b/apps/opencs/model/world/refiddata.cpp @@ -1,5 +1,7 @@ #include "refiddata.hpp" +#include + #include #include #include diff --git a/apps/opencs/model/world/refiddata.hpp b/apps/opencs/model/world/refiddata.hpp index 0b9fc66b53..85889f8d81 100644 --- a/apps/opencs/model/world/refiddata.hpp +++ b/apps/opencs/model/world/refiddata.hpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include "record.hpp" #include "universalid.hpp" diff --git a/apps/opencs/model/world/regionmap.cpp b/apps/opencs/model/world/regionmap.cpp index 557a8303b5..39a2fefadd 100644 --- a/apps/opencs/model/world/regionmap.cpp +++ b/apps/opencs/model/world/regionmap.cpp @@ -6,7 +6,7 @@ #include -#include +#include #include "data.hpp" #include "universalid.hpp" diff --git a/apps/opencs/model/world/resources.cpp b/apps/opencs/model/world/resources.cpp index cd9f58e848..71ee997413 100644 --- a/apps/opencs/model/world/resources.cpp +++ b/apps/opencs/model/world/resources.cpp @@ -7,7 +7,7 @@ #include -#include +#include CSMWorld::Resources::Resources (const VFS::Manager* vfs, const std::string& baseDirectory, UniversalId::Type type, const char * const *extensions) diff --git a/apps/opencs/model/world/scope.cpp b/apps/opencs/model/world/scope.cpp index 7f839a6dce..136b85e6b3 100644 --- a/apps/opencs/model/world/scope.cpp +++ b/apps/opencs/model/world/scope.cpp @@ -2,7 +2,7 @@ #include -#include +#include CSMWorld::Scope CSMWorld::getScopeFromId (const std::string& id) { diff --git a/apps/opencs/model/world/scriptcontext.cpp b/apps/opencs/model/world/scriptcontext.cpp index 2b6a9231b1..0bf7de9d95 100644 --- a/apps/opencs/model/world/scriptcontext.cpp +++ b/apps/opencs/model/world/scriptcontext.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/apps/opencs/view/doc/adjusterwidget.cpp b/apps/opencs/view/doc/adjusterwidget.cpp index 509e656c33..71d84285d7 100644 --- a/apps/opencs/view/doc/adjusterwidget.cpp +++ b/apps/opencs/view/doc/adjusterwidget.cpp @@ -1,6 +1,6 @@ #include "adjusterwidget.hpp" -#include +#include #include diff --git a/apps/opencs/view/render/cell.cpp b/apps/opencs/view/render/cell.cpp index 9ece61a979..7f8974ba6c 100644 --- a/apps/opencs/view/render/cell.cpp +++ b/apps/opencs/view/render/cell.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/opencs/view/render/cellwater.cpp b/apps/opencs/view/render/cellwater.cpp index b9391b7697..0f7b8670f2 100644 --- a/apps/opencs/view/render/cellwater.cpp +++ b/apps/opencs/view/render/cellwater.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/opencs/view/world/genericcreator.cpp b/apps/opencs/view/world/genericcreator.cpp index 7061c8a8b5..9aae777954 100644 --- a/apps/opencs/view/world/genericcreator.cpp +++ b/apps/opencs/view/world/genericcreator.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include "../../model/world/commands.hpp" #include "../../model/world/data.hpp" diff --git a/apps/opencs/view/world/idvalidator.cpp b/apps/opencs/view/world/idvalidator.cpp index 442157ac5d..efba4c5af9 100644 --- a/apps/opencs/view/world/idvalidator.cpp +++ b/apps/opencs/view/world/idvalidator.cpp @@ -1,6 +1,6 @@ #include "idvalidator.hpp" -#include +#include bool CSVWorld::IdValidator::isValid (const QChar& c, bool first) const { diff --git a/apps/opencs/view/world/infocreator.cpp b/apps/opencs/view/world/infocreator.cpp index cf1b48a195..d05a88098b 100644 --- a/apps/opencs/view/world/infocreator.cpp +++ b/apps/opencs/view/world/infocreator.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "../../model/doc/document.hpp" diff --git a/apps/opencs/view/world/table.cpp b/apps/opencs/view/world/table.cpp index a3ab3d19d3..8e2bc4250b 100644 --- a/apps/opencs/view/world/table.cpp +++ b/apps/opencs/view/world/table.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include "../../model/doc/document.hpp" diff --git a/apps/openmw/mwdialogue/dialoguemanagerimp.hpp b/apps/openmw/mwdialogue/dialoguemanagerimp.hpp index 5d0c5279d2..322c454c42 100644 --- a/apps/openmw/mwdialogue/dialoguemanagerimp.hpp +++ b/apps/openmw/mwdialogue/dialoguemanagerimp.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include "../mwworld/ptr.hpp" diff --git a/apps/openmw/mwdialogue/journalimp.cpp b/apps/openmw/mwdialogue/journalimp.cpp index 41b30a95ce..922c51d5d6 100644 --- a/apps/openmw/mwdialogue/journalimp.cpp +++ b/apps/openmw/mwdialogue/journalimp.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "../mwworld/esmstore.hpp" #include "../mwworld/class.hpp" diff --git a/apps/openmw/mwdialogue/keywordsearch.hpp b/apps/openmw/mwdialogue/keywordsearch.hpp index 3f932084fe..8c02210121 100644 --- a/apps/openmw/mwdialogue/keywordsearch.hpp +++ b/apps/openmw/mwdialogue/keywordsearch.hpp @@ -7,7 +7,8 @@ #include #include // std::reverse -#include +#include +#include namespace MWDialogue { diff --git a/apps/openmw/mwdialogue/selectwrapper.cpp b/apps/openmw/mwdialogue/selectwrapper.cpp index 4ee178a3ae..7f40baaeeb 100644 --- a/apps/openmw/mwdialogue/selectwrapper.cpp +++ b/apps/openmw/mwdialogue/selectwrapper.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include namespace { diff --git a/apps/openmw/mwgui/enchantingdialog.cpp b/apps/openmw/mwgui/enchantingdialog.cpp index ee0067f082..6c81036eba 100644 --- a/apps/openmw/mwgui/enchantingdialog.cpp +++ b/apps/openmw/mwgui/enchantingdialog.cpp @@ -7,6 +7,7 @@ #include #include +#include #include #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwgui/formatting.cpp b/apps/openmw/mwgui/formatting.cpp index 64e3847887..cc3c125552 100644 --- a/apps/openmw/mwgui/formatting.cpp +++ b/apps/openmw/mwgui/formatting.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index f7cbc30ae1..c28a36dd28 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -12,7 +12,7 @@ #include -#include +#include #include diff --git a/apps/openmw/mwgui/jailscreen.cpp b/apps/openmw/mwgui/jailscreen.cpp index 92c0fc9edc..b77d484445 100644 --- a/apps/openmw/mwgui/jailscreen.cpp +++ b/apps/openmw/mwgui/jailscreen.cpp @@ -1,6 +1,7 @@ #include #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/mechanicsmanager.hpp" diff --git a/apps/openmw/mwgui/journalviewmodel.cpp b/apps/openmw/mwgui/journalviewmodel.cpp index 1d1c954d8a..681398a06d 100644 --- a/apps/openmw/mwgui/journalviewmodel.cpp +++ b/apps/openmw/mwgui/journalviewmodel.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "../mwbase/world.hpp" #include "../mwbase/journal.hpp" diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp index d215587d49..908028e239 100644 --- a/apps/openmw/mwgui/journalwindow.cpp +++ b/apps/openmw/mwgui/journalwindow.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp index ccacdba108..e9190ffceb 100644 --- a/apps/openmw/mwgui/messagebox.cpp +++ b/apps/openmw/mwgui/messagebox.cpp @@ -6,7 +6,7 @@ #include #include -#include +#include #include "../mwbase/environment.hpp" #include "../mwbase/soundmanager.hpp" diff --git a/apps/openmw/mwgui/resourceskin.cpp b/apps/openmw/mwgui/resourceskin.cpp index 21ca2de54a..f549241a62 100644 --- a/apps/openmw/mwgui/resourceskin.cpp +++ b/apps/openmw/mwgui/resourceskin.cpp @@ -2,7 +2,7 @@ #include -#include +#include namespace MWGui { diff --git a/apps/openmw/mwgui/savegamedialog.cpp b/apps/openmw/mwgui/savegamedialog.cpp index 700b06e81e..71127c26e1 100644 --- a/apps/openmw/mwgui/savegamedialog.cpp +++ b/apps/openmw/mwgui/savegamedialog.cpp @@ -15,7 +15,7 @@ #include -#include +#include #include diff --git a/apps/openmw/mwgui/settingswindow.cpp b/apps/openmw/mwgui/settingswindow.cpp index f333ff2727..f83d3a562f 100644 --- a/apps/openmw/mwgui/settingswindow.cpp +++ b/apps/openmw/mwgui/settingswindow.cpp @@ -18,7 +18,8 @@ #include #include -#include +#include +#include #include #include #include diff --git a/apps/openmw/mwgui/sortfilteritemmodel.cpp b/apps/openmw/mwgui/sortfilteritemmodel.cpp index f1351218e5..3b02a48283 100644 --- a/apps/openmw/mwgui/sortfilteritemmodel.cpp +++ b/apps/openmw/mwgui/sortfilteritemmodel.cpp @@ -1,6 +1,5 @@ #include "sortfilteritemmodel.hpp" -#include #include #include #include diff --git a/apps/openmw/mwgui/spellbuyingwindow.cpp b/apps/openmw/mwgui/spellbuyingwindow.cpp index 9651513533..7bd56c878d 100644 --- a/apps/openmw/mwgui/spellbuyingwindow.cpp +++ b/apps/openmw/mwgui/spellbuyingwindow.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwgui/spellwindow.cpp b/apps/openmw/mwgui/spellwindow.cpp index 873037db10..f210d0bb81 100644 --- a/apps/openmw/mwgui/spellwindow.cpp +++ b/apps/openmw/mwgui/spellwindow.cpp @@ -3,8 +3,8 @@ #include #include -#include #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwgui/tradeitemmodel.cpp b/apps/openmw/mwgui/tradeitemmodel.cpp index f5144ba815..667832b05d 100644 --- a/apps/openmw/mwgui/tradeitemmodel.cpp +++ b/apps/openmw/mwgui/tradeitemmodel.cpp @@ -1,6 +1,6 @@ #include "tradeitemmodel.hpp" -#include +#include #include #include "../mwworld/class.hpp" diff --git a/apps/openmw/mwgui/tradewindow.cpp b/apps/openmw/mwgui/tradewindow.cpp index 9222e1444d..18ac1061ba 100644 --- a/apps/openmw/mwgui/tradewindow.cpp +++ b/apps/openmw/mwgui/tradewindow.cpp @@ -6,6 +6,7 @@ #include #include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwgui/waitdialog.cpp b/apps/openmw/mwgui/waitdialog.cpp index 53194e4f3f..2fe3cefb45 100644 --- a/apps/openmw/mwgui/waitdialog.cpp +++ b/apps/openmw/mwgui/waitdialog.cpp @@ -8,6 +8,7 @@ #include #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwlua/stats.cpp b/apps/openmw/mwlua/stats.cpp index 040d96e288..75a54eb622 100644 --- a/apps/openmw/mwlua/stats.cpp +++ b/apps/openmw/mwlua/stats.cpp @@ -7,7 +7,6 @@ #include #include -#include #include "localscripts.hpp" #include "luamanagerimp.hpp" diff --git a/apps/openmw/mwlua/uibindings.cpp b/apps/openmw/mwlua/uibindings.cpp index eec6509034..6fe6926489 100644 --- a/apps/openmw/mwlua/uibindings.cpp +++ b/apps/openmw/mwlua/uibindings.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "context.hpp" #include "luamanagerimp.hpp" diff --git a/apps/openmw/mwmechanics/activespells.cpp b/apps/openmw/mwmechanics/activespells.cpp index 148d0e11cc..4c450b1363 100644 --- a/apps/openmw/mwmechanics/activespells.cpp +++ b/apps/openmw/mwmechanics/activespells.cpp @@ -5,9 +5,10 @@ #include #include -#include #include +#include + #include #include diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index bde2a8ce18..fc6f7de52e 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/apps/openmw/mwmechanics/disease.hpp b/apps/openmw/mwmechanics/disease.hpp index 82c5236ca4..034561ad92 100644 --- a/apps/openmw/mwmechanics/disease.hpp +++ b/apps/openmw/mwmechanics/disease.hpp @@ -2,6 +2,7 @@ #define OPENMW_MECHANICS_DISEASE_H #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwmechanics/inventory.hpp b/apps/openmw/mwmechanics/inventory.hpp index ddd4b3351a..6ce04a675b 100644 --- a/apps/openmw/mwmechanics/inventory.hpp +++ b/apps/openmw/mwmechanics/inventory.hpp @@ -6,7 +6,7 @@ #include "../mwworld/esmstore.hpp" -#include +#include #include #include diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 34dcbb79a4..7e67b691ef 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -8,6 +8,8 @@ #include #include +#include + #include "../mwworld/esmstore.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwmechanics/recharge.cpp b/apps/openmw/mwmechanics/recharge.cpp index 1f92466e04..b61a77f493 100644 --- a/apps/openmw/mwmechanics/recharge.cpp +++ b/apps/openmw/mwmechanics/recharge.cpp @@ -1,6 +1,7 @@ #include "recharge.hpp" #include +#include #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwmechanics/repair.cpp b/apps/openmw/mwmechanics/repair.cpp index ac6cc5b414..15101bb81e 100644 --- a/apps/openmw/mwmechanics/repair.cpp +++ b/apps/openmw/mwmechanics/repair.cpp @@ -1,6 +1,7 @@ #include "repair.hpp" #include +#include #include "../mwbase/world.hpp" #include "../mwbase/environment.hpp" diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 92c683d41e..b0cc26c975 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "../mwbase/windowmanager.hpp" #include "../mwbase/soundmanager.hpp" diff --git a/apps/openmw/mwmechanics/spells.cpp b/apps/openmw/mwmechanics/spells.cpp index e3e8e849e4..27cf9bd854 100644 --- a/apps/openmw/mwmechanics/spells.cpp +++ b/apps/openmw/mwmechanics/spells.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwrender/actoranimation.cpp b/apps/openmw/mwrender/actoranimation.cpp index c238664ae5..6aec70d64e 100644 --- a/apps/openmw/mwrender/actoranimation.cpp +++ b/apps/openmw/mwrender/actoranimation.cpp @@ -16,7 +16,6 @@ #include #include -#include #include #include diff --git a/apps/openmw/mwrender/animation.hpp b/apps/openmw/mwrender/animation.hpp index 1b5f5aa298..ff7be5e7ea 100644 --- a/apps/openmw/mwrender/animation.hpp +++ b/apps/openmw/mwrender/animation.hpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/apps/openmw/mwrender/creatureanimation.cpp b/apps/openmw/mwrender/creatureanimation.cpp index 174ea036e1..9f647f877b 100644 --- a/apps/openmw/mwrender/creatureanimation.cpp +++ b/apps/openmw/mwrender/creatureanimation.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwrender/postprocessor.cpp b/apps/openmw/mwrender/postprocessor.cpp index 4902dc8ef8..f6af8d23bf 100644 --- a/apps/openmw/mwrender/postprocessor.cpp +++ b/apps/openmw/mwrender/postprocessor.cpp @@ -16,7 +16,8 @@ #include #include #include -#include +#include +#include #include #include #include diff --git a/apps/openmw/mwrender/screenshotmanager.cpp b/apps/openmw/mwrender/screenshotmanager.cpp index 40665cc250..f2457fecd8 100644 --- a/apps/openmw/mwrender/screenshotmanager.cpp +++ b/apps/openmw/mwrender/screenshotmanager.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 41fbc1c05b..159380b786 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -32,7 +32,6 @@ #include #include -#include #include #include diff --git a/apps/openmw/mwscript/containerextensions.cpp b/apps/openmw/mwscript/containerextensions.cpp index 8699d3dfe4..becc82ef9c 100644 --- a/apps/openmw/mwscript/containerextensions.cpp +++ b/apps/openmw/mwscript/containerextensions.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include diff --git a/apps/openmw/mwscript/globalscripts.cpp b/apps/openmw/mwscript/globalscripts.cpp index c1a25513e6..0739c49f1b 100644 --- a/apps/openmw/mwscript/globalscripts.cpp +++ b/apps/openmw/mwscript/globalscripts.cpp @@ -1,7 +1,7 @@ #include "globalscripts.hpp" #include -#include +#include #include #include diff --git a/apps/openmw/mwscript/scriptmanagerimp.cpp b/apps/openmw/mwscript/scriptmanagerimp.cpp index 7efb5148fa..61764684f5 100644 --- a/apps/openmw/mwscript/scriptmanagerimp.cpp +++ b/apps/openmw/mwscript/scriptmanagerimp.cpp @@ -9,7 +9,7 @@ #include -#include +#include #include #include diff --git a/apps/openmw/mwstate/character.cpp b/apps/openmw/mwstate/character.cpp index 2d82602534..8763cf6039 100644 --- a/apps/openmw/mwstate/character.cpp +++ b/apps/openmw/mwstate/character.cpp @@ -10,6 +10,8 @@ #include +#include + bool MWState::operator< (const Slot& left, const Slot& right) { return left.mTimeStamp -#include +#include #include "../mwbase/environment.hpp" #include "../mwbase/mechanicsmanager.hpp" diff --git a/apps/openmw/mwworld/cellpreloader.cpp b/apps/openmw/mwworld/cellpreloader.cpp index ff7869a393..daaab46c8f 100644 --- a/apps/openmw/mwworld/cellpreloader.cpp +++ b/apps/openmw/mwworld/cellpreloader.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp index b72b0e2db0..1f58ffa206 100644 --- a/apps/openmw/mwworld/containerstore.cpp +++ b/apps/openmw/mwworld/containerstore.cpp @@ -5,7 +5,8 @@ #include #include -#include +#include +#include #include "../mwbase/environment.hpp" #include "../mwbase/world.hpp" diff --git a/apps/openmw/mwworld/globals.cpp b/apps/openmw/mwworld/globals.cpp index 5b236996b3..cbf2600e0e 100644 --- a/apps/openmw/mwworld/globals.cpp +++ b/apps/openmw/mwworld/globals.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include "esmstore.hpp" diff --git a/apps/openmw/mwworld/groundcoverstore.cpp b/apps/openmw/mwworld/groundcoverstore.cpp index 0c3b016482..d6df136516 100644 --- a/apps/openmw/mwworld/groundcoverstore.cpp +++ b/apps/openmw/mwworld/groundcoverstore.cpp @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/apps/openmw/mwworld/store.hpp b/apps/openmw/mwworld/store.hpp index 29e1b53a72..ae376132c4 100644 --- a/apps/openmw/mwworld/store.hpp +++ b/apps/openmw/mwworld/store.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include "../mwdialogue/keywordsearch.hpp" diff --git a/apps/openmw_test_suite/misc/test_stringops.cpp b/apps/openmw_test_suite/misc/test_stringops.cpp index d21a74700c..539956d8a0 100644 --- a/apps/openmw_test_suite/misc/test_stringops.cpp +++ b/apps/openmw_test_suite/misc/test_stringops.cpp @@ -1,6 +1,10 @@ #include -#include "components/misc/stringops.hpp" -#include "components/misc/algorithm.hpp" + +#include +#include +#include + +#include #include #include @@ -55,7 +59,7 @@ TEST_F (PartialBinarySearchTest, ci_test) namespace { - using ::Misc::StringUtils; + using namespace ::Misc::StringUtils; using namespace ::testing; template @@ -65,7 +69,9 @@ namespace TYPED_TEST_P(MiscStringUtilsCiEqualEmptyTest, empty_strings_should_be_equal) { - EXPECT_TRUE(StringUtils::ciEqual(typename TypeParam::first_type {}, typename TypeParam::second_type {})); + const typename TypeParam::first_type a {}; + const typename TypeParam::second_type b {}; + EXPECT_TRUE(ciEqual(a, b)); } REGISTER_TYPED_TEST_SUITE_P(MiscStringUtilsCiEqualEmptyTest, @@ -104,21 +110,21 @@ namespace { const Value a {foo}; const Value b {foo}; - EXPECT_TRUE(StringUtils::ciEqual(a, b)) << a << "\n" << b; + EXPECT_TRUE(ciEqual(a, b)) << a << "\n" << b; } TYPED_TEST_P(MiscStringUtilsCiEqualNotEmptyTest, same_strings_with_different_case_sensetivity_should_be_equal) { const Value a {foo}; const Value b {fooUpper}; - EXPECT_TRUE(StringUtils::ciEqual(a, b)) << a << "\n" << b; + EXPECT_TRUE(ciEqual(a, b)) << a << "\n" << b; } TYPED_TEST_P(MiscStringUtilsCiEqualNotEmptyTest, different_strings_content_should_not_be_equal) { const Value a {foo}; const Value b {bar}; - EXPECT_FALSE(StringUtils::ciEqual(a, b)) << a << "\n" << b; + EXPECT_FALSE(ciEqual(a, b)) << a << "\n" << b; } REGISTER_TYPED_TEST_SUITE_P(MiscStringUtilsCiEqualNotEmptyTest, @@ -143,6 +149,6 @@ namespace TEST(MiscStringUtilsCiEqualTest, string_with_different_length_should_not_be_equal) { - EXPECT_FALSE(StringUtils::ciEqual(std::string("a"), std::string("aa"))); + EXPECT_FALSE(ciEqual(std::string("a"), std::string("aa"))); } } diff --git a/apps/openmw_test_suite/mwscript/test_utils.hpp b/apps/openmw_test_suite/mwscript/test_utils.hpp index 15f2fae661..780a0ac519 100644 --- a/apps/openmw_test_suite/mwscript/test_utils.hpp +++ b/apps/openmw_test_suite/mwscript/test_utils.hpp @@ -20,7 +20,7 @@ #include #include -#include +#include namespace { diff --git a/apps/openmw_test_suite/mwworld/test_store.cpp b/apps/openmw_test_suite/mwworld/test_store.cpp index 34079a8172..3f77aec498 100644 --- a/apps/openmw_test_suite/mwworld/test_store.cpp +++ b/apps/openmw_test_suite/mwworld/test_store.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include "apps/openmw/mwworld/esmstore.hpp" #include "apps/openmw/mwmechanics/spelllist.hpp" diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index 29940cef6f..a7b3e87f03 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -196,7 +196,7 @@ add_component_dir (esm4 ) add_component_dir (misc - constants utf8stream stringops resourcehelpers rng messageformatparser weakcache thread + constants utf8stream resourcehelpers rng messageformatparser weakcache thread compression osguservalues errorMarker color ) diff --git a/components/bsa/compressedbsafile.cpp b/components/bsa/compressedbsafile.cpp index 67e172e3db..e903a44dd9 100644 --- a/components/bsa/compressedbsafile.cpp +++ b/components/bsa/compressedbsafile.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include namespace Bsa diff --git a/components/compiler/declarationparser.cpp b/components/compiler/declarationparser.cpp index f29fe820c1..e27e9681af 100644 --- a/components/compiler/declarationparser.cpp +++ b/components/compiler/declarationparser.cpp @@ -1,6 +1,6 @@ #include "declarationparser.hpp" -#include +#include #include "scanner.hpp" #include "errorhandler.hpp" diff --git a/components/compiler/exprparser.cpp b/components/compiler/exprparser.cpp index 668946f839..4d9dcf9a4f 100644 --- a/components/compiler/exprparser.cpp +++ b/components/compiler/exprparser.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include "generator.hpp" #include "scanner.hpp" diff --git a/components/compiler/lineparser.cpp b/components/compiler/lineparser.cpp index 3ad8c5bbe2..405fdb3c2e 100644 --- a/components/compiler/lineparser.cpp +++ b/components/compiler/lineparser.cpp @@ -2,7 +2,7 @@ #include -#include +#include #include "scanner.hpp" #include "context.hpp" diff --git a/components/compiler/locals.cpp b/components/compiler/locals.cpp index 8492b8649e..4c5542a7d2 100644 --- a/components/compiler/locals.cpp +++ b/components/compiler/locals.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include namespace Compiler { diff --git a/components/compiler/parser.cpp b/components/compiler/parser.cpp index dc924b1bab..cc7ae49b0c 100644 --- a/components/compiler/parser.cpp +++ b/components/compiler/parser.cpp @@ -4,7 +4,7 @@ #include "exception.hpp" #include "scanner.hpp" -#include +#include namespace Compiler { diff --git a/components/compiler/scanner.cpp b/components/compiler/scanner.cpp index 161de1bb76..310b9fc411 100644 --- a/components/compiler/scanner.cpp +++ b/components/compiler/scanner.cpp @@ -8,7 +8,7 @@ #include "parser.hpp" #include "extensions.hpp" -#include +#include namespace Compiler { diff --git a/components/compiler/stringparser.cpp b/components/compiler/stringparser.cpp index a6423211c2..f6a0ca225f 100644 --- a/components/compiler/stringparser.cpp +++ b/components/compiler/stringparser.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include "scanner.hpp" #include "generator.hpp" diff --git a/components/detournavigator/navmeshdb.cpp b/components/detournavigator/navmeshdb.cpp index 93439387d7..c1fcf07796 100644 --- a/components/detournavigator/navmeshdb.cpp +++ b/components/detournavigator/navmeshdb.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include diff --git a/components/esm3/cellref.cpp b/components/esm3/cellref.cpp index 770680b8e2..1afd4bf863 100644 --- a/components/esm3/cellref.cpp +++ b/components/esm3/cellref.cpp @@ -1,5 +1,7 @@ #include "cellref.hpp" +#include + #include #include "esmreader.hpp" diff --git a/components/esm3/esmreader.cpp b/components/esm3/esmreader.cpp index 3e318cb2a6..84acd193f9 100644 --- a/components/esm3/esmreader.cpp +++ b/components/esm3/esmreader.cpp @@ -2,7 +2,7 @@ #include "readerscache.hpp" -#include +#include #include #include @@ -13,8 +13,6 @@ namespace ESM { -using namespace Misc; - ESM_Context ESMReader::getContext() { // Update the file position before returning diff --git a/components/esm3/esmreader.hpp b/components/esm3/esmreader.hpp index 4255428729..5a58e9d165 100644 --- a/components/esm3/esmreader.hpp +++ b/components/esm3/esmreader.hpp @@ -6,8 +6,6 @@ #include #include -#include - #include #include "components/esm/esmcommon.hpp" diff --git a/components/esm3/inventorystate.cpp b/components/esm3/inventorystate.cpp index 7dc971d205..c25ef27369 100644 --- a/components/esm3/inventorystate.cpp +++ b/components/esm3/inventorystate.cpp @@ -3,7 +3,7 @@ #include "esmreader.hpp" #include "esmwriter.hpp" -#include +#include namespace ESM { diff --git a/components/esm3/loadcell.cpp b/components/esm3/loadcell.cpp index c8cb58b190..dc32ee6a43 100644 --- a/components/esm3/loadcell.cpp +++ b/components/esm3/loadcell.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include "esmreader.hpp" #include "esmwriter.hpp" diff --git a/components/esm3/loadland.cpp b/components/esm3/loadland.cpp index e9012a92f0..ecc2412f59 100644 --- a/components/esm3/loadland.cpp +++ b/components/esm3/loadland.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "esmreader.hpp" #include "esmwriter.hpp" diff --git a/components/esm3/loadmgef.cpp b/components/esm3/loadmgef.cpp index 28f9982ab7..5d4d318694 100644 --- a/components/esm3/loadmgef.cpp +++ b/components/esm3/loadmgef.cpp @@ -6,6 +6,8 @@ #include "esmwriter.hpp" #include "components/esm/defs.hpp" +#include + namespace ESM { namespace diff --git a/components/esm3/loadscpt.cpp b/components/esm3/loadscpt.cpp index 9f59dfbf23..3f478d09a8 100644 --- a/components/esm3/loadscpt.cpp +++ b/components/esm3/loadscpt.cpp @@ -1,6 +1,7 @@ #include "loadscpt.hpp" #include +#include #include diff --git a/components/esm3/spelllist.cpp b/components/esm3/spelllist.cpp index 168a8c7448..9e20ba2644 100644 --- a/components/esm3/spelllist.cpp +++ b/components/esm3/spelllist.cpp @@ -3,6 +3,8 @@ #include "esmreader.hpp" #include "esmwriter.hpp" +#include + namespace ESM { diff --git a/components/esm3terrain/storage.cpp b/components/esm3terrain/storage.cpp index 4d3f3c3059..f9aab5367e 100644 --- a/components/esm3terrain/storage.cpp +++ b/components/esm3terrain/storage.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include #include namespace ESMTerrain diff --git a/components/esm4/reader.cpp b/components/esm4/reader.cpp index 3c0ac470c4..f33fb0aed1 100644 --- a/components/esm4/reader.cpp +++ b/components/esm4/reader.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include "formid.hpp" diff --git a/components/esmloader/esmdata.cpp b/components/esmloader/esmdata.cpp index fd7d0f622c..7b27a2f14c 100644 --- a/components/esmloader/esmdata.cpp +++ b/components/esmloader/esmdata.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include diff --git a/components/esmloader/load.cpp b/components/esmloader/load.cpp index d3c170bc4c..8d407515f2 100644 --- a/components/esmloader/load.cpp +++ b/components/esmloader/load.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/components/files/collections.cpp b/components/files/collections.cpp index 3668aeadcd..62da9fdd4e 100644 --- a/components/files/collections.cpp +++ b/components/files/collections.cpp @@ -1,6 +1,7 @@ #include "collections.hpp" -#include +#include +#include namespace Files { diff --git a/components/files/linuxpath.cpp b/components/files/linuxpath.cpp index 7f659e10ea..da3bfeac77 100644 --- a/components/files/linuxpath.cpp +++ b/components/files/linuxpath.cpp @@ -7,8 +7,7 @@ #include #include -#include - +#include namespace { diff --git a/components/files/macospath.cpp b/components/files/macospath.cpp index 32c35c98f1..eccaf2f2f8 100644 --- a/components/files/macospath.cpp +++ b/components/files/macospath.cpp @@ -7,7 +7,7 @@ #include #include -#include +#include namespace { diff --git a/components/files/multidircollection.hpp b/components/files/multidircollection.hpp index c967f30169..7e8884eec0 100644 --- a/components/files/multidircollection.hpp +++ b/components/files/multidircollection.hpp @@ -8,7 +8,7 @@ #include -#include +#include namespace Files { diff --git a/components/fontloader/fontloader.cpp b/components/fontloader/fontloader.cpp index c50a523d1b..ad945f3590 100644 --- a/components/fontloader/fontloader.cpp +++ b/components/fontloader/fontloader.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include diff --git a/components/fx/lexer.cpp b/components/fx/lexer.cpp index d416dd692d..7517631bd6 100644 --- a/components/fx/lexer.cpp +++ b/components/fx/lexer.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include diff --git a/components/fx/pass.cpp b/components/fx/pass.cpp index 27d6f6ef0a..9abeefd12e 100644 --- a/components/fx/pass.cpp +++ b/components/fx/pass.cpp @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/components/fx/technique.cpp b/components/fx/technique.cpp index eaa74e3e3b..444701cea5 100644 --- a/components/fx/technique.cpp +++ b/components/fx/technique.cpp @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/components/fx/types.hpp b/components/fx/types.hpp index ba809cdd9a..16f73115ff 100644 --- a/components/fx/types.hpp +++ b/components/fx/types.hpp @@ -2,6 +2,7 @@ #define OPENMW_COMPONENTS_FX_TYPES_H #include +#include #include #include @@ -14,7 +15,7 @@ #include #include -#include +#include #include #include "pass.hpp" diff --git a/components/fx/widgets.hpp b/components/fx/widgets.hpp index 061bd2d959..23b578ad27 100644 --- a/components/fx/widgets.hpp +++ b/components/fx/widgets.hpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include "technique.hpp" #include "types.hpp" diff --git a/components/interpreter/defines.cpp b/components/interpreter/defines.cpp index cb08e176a7..1e8d91dfa6 100644 --- a/components/interpreter/defines.cpp +++ b/components/interpreter/defines.cpp @@ -3,9 +3,10 @@ #include #include #include +#include #include -#include +#include namespace Interpreter{ diff --git a/components/lua/configuration.cpp b/components/lua/configuration.cpp index b4889c44d1..c4ee7d1865 100644 --- a/components/lua/configuration.cpp +++ b/components/lua/configuration.cpp @@ -5,7 +5,9 @@ #include #include -#include +#include +#include +#include namespace LuaUtil { diff --git a/components/lua_ui/resources.cpp b/components/lua_ui/resources.cpp index 0f9890c523..19738f43ff 100644 --- a/components/lua_ui/resources.cpp +++ b/components/lua_ui/resources.cpp @@ -1,7 +1,6 @@ #include "resources.hpp" #include -#include namespace LuaUi { diff --git a/components/misc/algorithm.hpp b/components/misc/algorithm.hpp index 54ac74e97e..536b2b3f74 100644 --- a/components/misc/algorithm.hpp +++ b/components/misc/algorithm.hpp @@ -4,7 +4,7 @@ #include #include -#include "stringops.hpp" +#include namespace Misc { diff --git a/components/misc/resourcehelpers.cpp b/components/misc/resourcehelpers.cpp index 73a1d961e7..40f9a00338 100644 --- a/components/misc/resourcehelpers.cpp +++ b/components/misc/resourcehelpers.cpp @@ -2,8 +2,10 @@ #include #include +#include -#include +#include +#include #include diff --git a/components/misc/stringops.hpp b/components/misc/stringops.hpp deleted file mode 100644 index 3fa82a27fe..0000000000 --- a/components/misc/stringops.hpp +++ /dev/null @@ -1,252 +0,0 @@ -#ifndef MISC_STRINGOPS_H -#define MISC_STRINGOPS_H - -#include -#include -#include -#include -#include -#include - -/* Mapping table to go from uppercase to lowercase for plain ASCII.*/ -static constexpr unsigned char tolowermap[256] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 -}; - -namespace Misc -{ -class StringUtils -{ - struct ci - { - bool operator()(char x, char y) const { - return toLower(x) < toLower(y); - } - }; - - // Allow to convert complex arguments to C-style strings for format() function - template - static T argument(T value) noexcept - { - static_assert(!std::is_same_v, "std::string_view is not supported"); - return value; - } - - template - static T const * argument(std::basic_string const & value) noexcept - { - return value.c_str(); - } - -public: - - /// Plain and simple locale-unaware toLower. Anything from A to Z is lower-cased, multibyte characters are unchanged. - /// Don't use std::tolower(char, locale&) because that is abysmally slow. - /// Don't use tolower(int) because that depends on global locale. - static constexpr char toLower(char c) - { - return tolowermap[static_cast(c)]; - } - - static bool ciLess(std::string_view x, std::string_view y) - { - return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), ci()); - } - - template - static bool ciEqual(const X& x, const Y& y) - { - if (std::size(x) != std::size(y)) - return false; - return std::equal(std::begin(x), std::end(x), std::begin(y), - [] (char l, char r) { return toLower(l) == toLower(r); }); - } - - template - static auto ciEqual(const char(& x)[n], const char(& y)[n]) - { - static_assert(n > 0); - return ciEqual(std::string_view(x, n - 1), std::string_view(y, n - 1)); - } - - template - static auto ciEqual(const char(& x)[n], const T& y) - { - static_assert(n > 0); - return ciEqual(std::string_view(x, n - 1), y); - } - - template - static auto ciEqual(const T& x, const char(& y)[n]) - { - static_assert(n > 0); - return ciEqual(x, std::string_view(y, n - 1)); - } - - static int ciCompareLen(std::string_view x, std::string_view y, std::size_t len) - { - std::string_view::const_iterator xit = x.begin(); - std::string_view::const_iterator yit = y.begin(); - for(;xit != x.end() && yit != y.end() && len > 0;++xit,++yit,--len) - { - char left = *xit; - char right = *yit; - if (left == right) - continue; - - left = toLower(left); - right = toLower(right); - int res = left - right; - if(res != 0) - return (res > 0) ? 1 : -1; - } - if(len > 0) - { - if(xit != x.end()) - return 1; - if(yit != y.end()) - return -1; - } - return 0; - } - - /// Transforms input string to lower case w/o copy - static void lowerCaseInPlace(std::string &inout) { - for (unsigned int i=0; i{}(str); - } - }; - - struct CiComp - { - bool operator()(std::string_view left, std::string_view right) const - { - return ciLess(left, right); - } - }; - - /** @brief Replaces all occurrences of a string in another string. - * - * @param str The string to operate on. - * @param what The string to replace. - * @param with The replacement string. - * @return A reference to the string passed in @p str. - */ - static std::string &replaceAll(std::string &str, std::string_view what, std::string_view with) - { - std::size_t found; - std::size_t offset = 0; - while((found = str.find(what, offset)) != std::string::npos) - { - str.replace(found, what.size(), with); - offset = found + with.size(); - } - return str; - } - - // Requires some C++11 features: - // 1. std::string needs to be contiguous - // 2. std::snprintf with zero size (second argument) returns an output string size - // 3. variadic templates support - template - static std::string format(const char* fmt, Args const & ... args) - { - auto size = std::snprintf(nullptr, 0, fmt, argument(args) ...); - // Note: sprintf also writes a trailing null character. We should remove it. - std::string ret(size+1, '\0'); - std::sprintf(&ret[0], fmt, argument(args) ...); - ret.erase(size); - - return ret; - } - - template - static std::string format(const std::string& fmt, Args const & ... args) - { - return format(fmt.c_str(), args ...); - } - - static inline void trim(std::string &s) - { - const auto notSpace = [](char ch) - { - // TODO Do we care about multibyte whitespace? - return !std::isspace(static_cast(ch)); - }; - // left trim - s.erase(s.begin(), std::find_if(s.begin(), s.end(), notSpace)); - - // right trim - s.erase(std::find_if(s.rbegin(), s.rend(), notSpace).base(), s.end()); - } - - template - static inline void split(std::string_view str, Container& cont, std::string_view delims = " ") - { - std::size_t current = str.find_first_of(delims); - std::size_t previous = 0; - while (current != std::string::npos) - { - cont.emplace_back(str.substr(previous, current - previous)); - previous = current + 1; - current = str.find_first_of(delims, previous); - } - cont.emplace_back(str.substr(previous, current - previous)); - } - - static inline void replaceLast(std::string& str, std::string_view substr, std::string_view with) - { - size_t pos = str.rfind(substr); - if (pos == std::string::npos) - return; - str.replace(pos, substr.size(), with); - } - - static inline bool ciEndsWith(std::string_view s, std::string_view suffix) - { - return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin(), - [](char l, char r) { return toLower(l) == toLower(r); }); - }; -}; - -} - -#endif diff --git a/components/misc/strings/algorithm.hpp b/components/misc/strings/algorithm.hpp new file mode 100644 index 0000000000..3bce11e20e --- /dev/null +++ b/components/misc/strings/algorithm.hpp @@ -0,0 +1,145 @@ +#ifndef COMPONENTS_MISC_STRINGS_ALGORITHM_H +#define COMPONENTS_MISC_STRINGS_ALGORITHM_H + +#include "lower.hpp" + +#include +#include +#include +#include + +namespace Misc::StringUtils +{ + struct CiCharLess + { + bool operator()(char x, char y) const { return toLower(x) < toLower(y); } + }; + + inline bool ciLess(std::string_view x, std::string_view y) + { + return std::lexicographical_compare(x.begin(), x.end(), y.begin(), y.end(), CiCharLess()); + } + + inline bool ciEqual(std::string_view x, std::string_view y) + { + if (std::size(x) != std::size(y)) + return false; + return std::equal(std::begin(x), std::end(x), std::begin(y), + [] (char l, char r) { return toLower(l) == toLower(r); }); + } + + inline int ciCompareLen(std::string_view x, std::string_view y, std::size_t len) + { + std::string_view::const_iterator xit = x.begin(); + std::string_view::const_iterator yit = y.begin(); + for(; xit != x.end() && yit != y.end() && len > 0; ++xit, ++yit, --len) + { + char left = *xit; + char right = *yit; + if (left == right) + continue; + + left = toLower(left); + right = toLower(right); + int res = left - right; + if(res != 0) + return (res > 0) ? 1 : -1; + } + if(len > 0) + { + if(xit != x.end()) + return 1; + if(yit != y.end()) + return -1; + } + return 0; + } + + struct CiEqual + { + bool operator()(std::string_view left, std::string_view right) const + { + return ciEqual(left, right); + } + }; + + struct CiHash + { + std::size_t operator()(std::string str) const + { + lowerCaseInPlace(str); + return std::hash{}(str); + } + }; + + struct CiComp + { + bool operator()(std::string_view left, std::string_view right) const + { + return ciLess(left, right); + } + }; + + /** @brief Replaces all occurrences of a string in another string. + * + * @param str The string to operate on. + * @param what The string to replace. + * @param with The replacement string. + * @return A reference to the string passed in @p str. + */ + inline std::string& replaceAll(std::string& str, std::string_view what, std::string_view with) + { + std::size_t found; + std::size_t offset = 0; + while ((found = str.find(what, offset)) != std::string::npos) + { + str.replace(found, what.size(), with); + offset = found + with.size(); + } + return str; + } + + inline bool ciEndsWith(std::string_view s, std::string_view suffix) + { + return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin(), + [](char l, char r) { return toLower(l) == toLower(r); }); + } + + inline void trim(std::string& s) + { + const auto notSpace = [](char ch) + { + // TODO Do we care about multibyte whitespace? + return !std::isspace(static_cast(ch)); + }; + // left trim + s.erase(s.begin(), std::find_if(s.begin(), s.end(), notSpace)); + + // right trim + s.erase(std::find_if(s.rbegin(), s.rend(), notSpace).base(), s.end()); + } + + template + void split(std::string_view str, Container& cont, std::string_view delims = " ") + { + std::size_t current = str.find_first_of(delims); + std::size_t previous = 0; + while (current != std::string::npos) + { + cont.emplace_back(str.substr(previous, current - previous)); + previous = current + 1; + current = str.find_first_of(delims, previous); + } + cont.emplace_back(str.substr(previous, current - previous)); + } + + inline void replaceLast(std::string& str, std::string_view substr, std::string_view with) + { + const std::size_t pos = str.rfind(substr); + if (pos == std::string::npos) + return; + str.replace(pos, substr.size(), with); + } +} + +#endif diff --git a/components/misc/strings/format.hpp b/components/misc/strings/format.hpp new file mode 100644 index 0000000000..492518fe22 --- /dev/null +++ b/components/misc/strings/format.hpp @@ -0,0 +1,55 @@ +#ifndef COMPONENTS_MISC_STRINGS_FORMAT_H +#define COMPONENTS_MISC_STRINGS_FORMAT_H + +#include +#include +#include +#include +#include +#include + +namespace Misc::StringUtils +{ + namespace Details + { + // Allow to convert complex arguments to C-style strings for format() function + template + T argument(T value) noexcept + { + static_assert(!std::is_same_v, "std::string_view is not supported"); + return value; + } + + template + T const * argument(std::basic_string const & value) noexcept + { + return value.c_str(); + } + } + + // Requires some C++11 features: + // 1. std::string needs to be contiguous + // 2. std::snprintf with zero size (second argument) returns an output string size + // 3. variadic templates support + template + std::string format(const char* fmt, Args const & ... args) + { + const int size = std::snprintf(nullptr, 0, fmt, Details::argument(args) ...); + if (size < 0) + throw std::runtime_error(std::string("Failed to compute resulting string size: ") + std::strerror(errno)); + // Note: sprintf also writes a trailing null character. We should remove it. + std::string ret(static_cast(size) + 1, '\0'); + if (std::sprintf(ret.data(), fmt, Details::argument(args) ...) < 0) + throw std::runtime_error(std::string("Failed to format string: ") + std::strerror(errno)); + ret.erase(static_cast(size)); + return ret; + } + + template + std::string format(const std::string& fmt, Args const & ... args) + { + return format(fmt.c_str(), args ...); + } +} + +#endif diff --git a/components/misc/strings/lower.hpp b/components/misc/strings/lower.hpp new file mode 100644 index 0000000000..8486af7c6d --- /dev/null +++ b/components/misc/strings/lower.hpp @@ -0,0 +1,52 @@ +#ifndef COMPONENTS_MISC_STRINGS_LOWER_H +#define COMPONENTS_MISC_STRINGS_LOWER_H + +#include +#include + +namespace Misc::StringUtils +{ + /* Mapping table to go from uppercase to lowercase for plain ASCII.*/ + static constexpr unsigned char tolowermap[256] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255 + }; + + /// Plain and simple locale-unaware toLower. Anything from A to Z is lower-cased, multibyte characters are unchanged. + /// Don't use std::tolower(char, locale&) because that is abysmally slow. + /// Don't use tolower(int) because that depends on global locale. + inline constexpr char toLower(char c) + { + return tolowermap[static_cast(c)]; + } + + /// Transforms input string to lower case w/o copy + inline void lowerCaseInPlace(std::string& str) + { + for (char& ch : str) + ch = toLower(ch); + } + + /// Returns lower case copy of input string + inline std::string lowerCase(std::string_view in) + { + std::string out(in); + lowerCaseInPlace(out); + return out; + } +} + +#endif diff --git a/components/nif/node.cpp b/components/nif/node.cpp index 7c92cd3851..089ea6f615 100644 --- a/components/nif/node.cpp +++ b/components/nif/node.cpp @@ -1,6 +1,6 @@ #include "node.hpp" -#include +#include #include "data.hpp" #include "physics.hpp" diff --git a/components/nifbullet/bulletnifloader.cpp b/components/nifbullet/bulletnifloader.cpp index bae5bd4565..80f7672c20 100644 --- a/components/nifbullet/bulletnifloader.cpp +++ b/components/nifbullet/bulletnifloader.cpp @@ -12,7 +12,8 @@ #include #include -#include + +#include #include #include diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 474fc30c32..129f180493 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -15,8 +15,9 @@ // resource #include #include -#include #include +#include +#include #include #include #include diff --git a/components/resource/foreachbulletobject.cpp b/components/resource/foreachbulletobject.cpp index dc154802e0..5b4b4ef6eb 100644 --- a/components/resource/foreachbulletobject.cpp +++ b/components/resource/foreachbulletobject.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/components/resource/keyframemanager.cpp b/components/resource/keyframemanager.cpp index c017615f42..b892ce3135 100644 --- a/components/resource/keyframemanager.cpp +++ b/components/resource/keyframemanager.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include "animation.hpp" #include "objectcache.hpp" diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 094220938b..1a00e18760 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/components/sceneutil/attach.cpp b/components/sceneutil/attach.cpp index 02c3456425..3529ffe2f5 100644 --- a/components/sceneutil/attach.cpp +++ b/components/sceneutil/attach.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/components/sceneutil/lightmanager.cpp b/components/sceneutil/lightmanager.cpp index be3fe4679b..144063741e 100644 --- a/components/sceneutil/lightmanager.cpp +++ b/components/sceneutil/lightmanager.cpp @@ -17,7 +17,6 @@ #include #include -#include #include #include diff --git a/components/sceneutil/osgacontroller.cpp b/components/sceneutil/osgacontroller.cpp index 0f9cf4ce6e..b7981cf4e5 100644 --- a/components/sceneutil/osgacontroller.cpp +++ b/components/sceneutil/osgacontroller.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/components/sceneutil/shadow.cpp b/components/sceneutil/shadow.cpp index 5220fce78a..8727dec37d 100644 --- a/components/sceneutil/shadow.cpp +++ b/components/sceneutil/shadow.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/components/sceneutil/skeleton.cpp b/components/sceneutil/skeleton.cpp index 5c8449a50d..f319a63587 100644 --- a/components/sceneutil/skeleton.cpp +++ b/components/sceneutil/skeleton.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include diff --git a/components/sceneutil/visitor.cpp b/components/sceneutil/visitor.cpp index ea09445678..bd7829f7a1 100644 --- a/components/sceneutil/visitor.cpp +++ b/components/sceneutil/visitor.cpp @@ -6,8 +6,7 @@ #include #include - -#include +#include #include #include diff --git a/components/sceneutil/visitor.hpp b/components/sceneutil/visitor.hpp index 45aa408b9e..5fafcec759 100644 --- a/components/sceneutil/visitor.hpp +++ b/components/sceneutil/visitor.hpp @@ -6,7 +6,7 @@ #include -#include +#include // Commonly used scene graph visitors namespace SceneUtil diff --git a/components/settings/parser.cpp b/components/settings/parser.cpp index 778888d2d2..cbc51ff220 100644 --- a/components/settings/parser.cpp +++ b/components/settings/parser.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include diff --git a/components/settings/settings.cpp b/components/settings/settings.cpp index dfd124f3cf..6591fd005b 100644 --- a/components/settings/settings.cpp +++ b/components/settings/settings.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include namespace Settings { diff --git a/components/shader/shadermanager.cpp b/components/shader/shadermanager.cpp index 8136bab447..e0443edcc5 100644 --- a/components/shader/shadermanager.cpp +++ b/components/shader/shadermanager.cpp @@ -9,7 +9,8 @@ #include #include -#include +#include +#include #include namespace Shader diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp index 08f6894f71..207caff086 100644 --- a/components/shader/shadervisitor.cpp +++ b/components/shader/shadervisitor.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include diff --git a/components/stereo/frustum.cpp b/components/stereo/frustum.cpp index 40a355ed55..7f8dbc952a 100644 --- a/components/stereo/frustum.cpp +++ b/components/stereo/frustum.cpp @@ -27,9 +27,6 @@ #include -#include - -#include #include "frustum.hpp" namespace Stereo diff --git a/components/stereo/stereomanager.cpp b/components/stereo/stereomanager.cpp index 2c4b8a35e6..29dca8fb4a 100644 --- a/components/stereo/stereomanager.cpp +++ b/components/stereo/stereomanager.cpp @@ -28,8 +28,6 @@ #include -#include - namespace Stereo { // Update stereo view/projection during update diff --git a/components/vfs/manager.cpp b/components/vfs/manager.cpp index 13fea30f59..c8434fd9fd 100644 --- a/components/vfs/manager.cpp +++ b/components/vfs/manager.cpp @@ -2,8 +2,9 @@ #include #include +#include -#include +#include #include "archive.hpp"