1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00
elsid f99ed6f1db
Split components/misc/stringops.hpp into multiple headers
Replace all ciEqual overloads with one having std::string_view as argument.
2022-08-03 22:06:24 +02:00

25 lines
529 B
C++

#include "scope.hpp"
#include <stdexcept>
#include <components/misc/strings/lower.hpp>
CSMWorld::Scope CSMWorld::getScopeFromId (const std::string& id)
{
// get root namespace
std::string namespace_;
std::string::size_type i = id.find ("::");
if (i!=std::string::npos)
namespace_ = Misc::StringUtils::lowerCase(std::string_view(id).substr(0, i));
if (namespace_=="project")
return Scope_Project;
if (namespace_=="session")
return Scope_Session;
return Scope_Content;
}