yaze
0.2.0
Link to the Past ROM Editor
Loading...
Searching...
No Matches
file_util.h
Go to the documentation of this file.
1
#ifndef YAZE_APP_CORE_UTILS_FILE_UTIL_H
2
#define YAZE_APP_CORE_UTILS_FILE_UTIL_H
3
4
#include <string>
5
6
namespace
yaze
{
7
namespace
app {
8
namespace
core {
9
10
std::string
GetFileExtension
(
const
std::string& filename) {
11
size_t
dot = filename.find_last_of(
"."
);
12
if
(dot == std::string::npos) {
13
return
""
;
14
}
15
return
filename.substr(dot + 1);
16
}
17
18
std::string
GetFileName
(
const
std::string& filename) {
19
size_t
slash = filename.find_last_of(
"/"
);
20
if
(slash == std::string::npos) {
21
return
filename;
22
}
23
return
filename.substr(slash + 1);
24
}
25
26
std::string
LoadFile
(
const
std::string& filename);
27
28
}
// namespace core
29
}
// namespace app
30
}
// namespace yaze
31
32
#endif
// YAZE_APP_CORE_UTILS_FILE_UTIL_H
yaze::app::core::GetFileName
std::string GetFileName(const std::string &filename)
Definition
file_util.h:18
yaze::app::core::GetFileExtension
std::string GetFileExtension(const std::string &filename)
Definition
file_util.h:10
yaze::app::core::LoadFile
std::string LoadFile(const std::string &filename)
Definition
file_util.cc:17
yaze
Definition
common.cc:21
src
app
core
utils
file_util.h
Generated by
1.12.0