少年修仙传客户端基础资源
hch
2024-04-11 4c71d74b77c9eb62a0323698c9a0db3b641a917e
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 */