-
-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathOperationDepth.cpp
More file actions
22 lines (18 loc) · 661 Bytes
/
OperationDepth.cpp
File metadata and controls
22 lines (18 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "OperationDepth.h"
#include "Helpers.h"
ClassFactory<OperationDepth> OperationDepth::RegisteredFactory(GetCommand());
OperationDepth::OperationDepth(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);
// parse the argument off the argument
const int iDepth = _wtoi(sSubArgs.at(0).c_str());
if (iDepth < 0)
{
// complain
Print(L"ERROR: Invalid depth specified for parameter '{}'.", GetCommand());
std::exit(-1);
}
// store for dynamic lookup
MaxDepth() = iDepth;
};