33 const DWORD bufferSize = 4096;
34 char applicationBuffer[bufferSize];
35 DWORD count = GetModuleFileName(NULL, applicationBuffer, bufferSize);
36 if (count != 0 && count < bufferSize) {
37 std::string applicationPath(applicationBuffer, count);
38 applicationPath = std::string(applicationPath, 0, applicationPath.find_last_of(
"\\"));
40 mPluginPaths.push_back(applicationPath +
"\\alvarplugins");
55 #if defined(_MSC_VER) && (_MSC_VER < 1400) 56 buffer = getenv(variable.data());
58 path = std::string(buffer);
62 getenv_s(&requiredSize, NULL, 0, variable.data());
63 if (requiredSize > 0) {
64 buffer = (
char *)malloc(requiredSize *
sizeof(
char));
65 getenv_s(&requiredSize, buffer, requiredSize, variable.data());
66 path = std::string(buffer, requiredSize - 1);
74 std::string::size_type
start = 0;
75 std::string::size_type end = 0;
76 while ((end = path.find_first_of(delimitor, start)) != std::string::npos) {
77 std::string tmp(path, start, end - start);
83 if (start != path.size()) {
84 std::string tmp(path, start, std::string::npos);
94 return std::string(
"");
99 return std::string(
"dll");
PluginPathsVector mPluginPaths
std::string pluginExtension()
void parseEnvironmentVariable(const std::string &variable)
std::string pluginPrefix()