forked from focus-creative-games/il2cpp_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnvironment.cpp
More file actions
40 lines (33 loc) · 918 Bytes
/
Environment.cpp
File metadata and controls
40 lines (33 loc) · 918 Bytes
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
30
31
32
33
34
35
36
37
38
39
40
#include "il2cpp-config.h"
#include "utils/StringUtils.h"
#include "utils/Environment.h"
namespace il2cpp
{
namespace utils
{
static int s_ArgCount = 0;
static std::vector<UTF16String> s_Args;
void Environment::SetMainArgs(const char* const* args, int num_args)
{
s_ArgCount = num_args;
s_Args.resize(num_args);
for (int i = 0; i < num_args; i++)
s_Args[i] = utils::StringUtils::Utf8ToUtf16(args[i]);
}
void Environment::SetMainArgs(const Il2CppChar* const* args, int num_args)
{
s_ArgCount = num_args;
s_Args.resize(num_args);
for (int i = 0; i < num_args; i++)
s_Args[i] = args[i];
}
const std::vector<UTF16String>& Environment::GetMainArgs()
{
return s_Args;
}
int Environment::GetNumMainArgs()
{
return s_ArgCount;
}
} /* namespace vm */
} /* namespace il2cpp */