You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
509 B
C++
25 lines
509 B
C++
#include "scope.hpp"
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <components/misc/stringops.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 (id.substr (0, i));
|
|
|
|
if (namespace_=="project")
|
|
return Scope_Project;
|
|
|
|
if (namespace_=="session")
|
|
return Scope_Session;
|
|
|
|
return Scope_Content;
|
|
}
|