forked from ObEngine/ObEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorkspace.cpp
More file actions
29 lines (26 loc) · 1.12 KB
/
Copy pathWorkspace.cpp
File metadata and controls
29 lines (26 loc) · 1.12 KB
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
#include "Workspace.hpp"
namespace obe
{
namespace System
{
std::string Workspace::GetWorkspaceLocation(std::string workspaceName)
{
if (WorkspaceExists(workspaceName))
return (vili::DataParser("Workspace/Workspaces.vili")->at<vili::BaseAttribute>(workspaceName, "path")->get<std::string>());
throw aube::ErrorHandler::Raise("ObEngine.Workspace.Workspace.InexistantWorkspace", { {"workspace", workspaceName} });
}
bool Workspace::WorkspaceExists(std::string workspaceName)
{
return (vili::DataParser("Workspace/Workspaces.vili")->contains(vili::Types::ComplexAttribute, workspaceName));
}
bool Workspace::Load(std::string workspaceName, unsigned int priority)
{
if (WorkspaceExists(workspaceName)) {
Path::addPath(obe::System::PriorizedPath(obe::System::PathType::Workspace, GetWorkspaceLocation(workspaceName), priority));
std::cout << "<System> Mounting Workspace : " << workspaceName << " : " << GetWorkspaceLocation(workspaceName) << std::endl;
return true;
}
throw aube::ErrorHandler::Raise("ObEngine.Workspace.Workspace.InexistantWorkspace", { { "workspace", workspaceName } });
}
}
}