-
-
Notifications
You must be signed in to change notification settings - Fork 16
/
OperationPathMode.cpp
22 lines (19 loc) · 978 Bytes
/
OperationPathMode.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "OperationPathMode.h"
#include "InputOutput.h"
#include "Helpers.h"
ClassFactory<OperationPathMode> OperationPathMode::RegisteredFactory(GetCommand());
OperationPathMode::OperationPathMode(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
const std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList, L"\\0");
// see what mode the argument
if (_wcsicmp(sSubArgs.at(0).c_str(), L"REG") == 0 || _wcsicmp(sSubArgs.at(0).c_str(), L"REGISTRY") == 0) GetPathMode() = SE_REGISTRY_KEY;
else if (_wcsicmp(sSubArgs.at(0).c_str(), L"ADS") == 0 || _wcsicmp(sSubArgs.at(0).c_str(), L"ACTIVEDIRECTORY") == 0) GetPathMode() = SE_DS_OBJECT;
else if (_wcsicmp(sSubArgs.at(0).c_str(), L"FILE") == 0) GetPathMode() = SE_FILE_OBJECT;
else
{
// complain
wprintf(L"ERROR: Invalid path mode specified for parameter '%s'.\n", GetCommand().c_str());
std::exit(-1);
}
};