forked from focus-creative-games/il2cpp_plus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPathUtils.cpp
More file actions
39 lines (31 loc) · 743 Bytes
/
PathUtils.cpp
File metadata and controls
39 lines (31 loc) · 743 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
#include "il2cpp-config.h"
#include "utils/PathUtils.h"
#include <string>
namespace il2cpp
{
namespace utils
{
namespace PathUtils
{
std::string BasenameNoExtension(const std::string& path)
{
if (path.empty())
return ".";
std::string base = Basename(path);
const size_t pos = base.rfind('.');
// No extension.
if (pos == std::string::npos)
return base;
return base.substr(0, pos);
}
std::string PathNoExtension(const std::string& path)
{
const size_t pos = path.rfind('.');
// No extension.
if (pos == std::string::npos)
return path;
return path.substr(0, pos);
}
}
} /* utils */
} /* il2cpp */