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
6namespace yaze {
7namespace app {
8namespace core {
9
10std::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
18std::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
26std::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
std::string GetFileName(const std::string &filename)
Definition file_util.h:18
std::string GetFileExtension(const std::string &filename)
Definition file_util.h:10
std::string LoadFile(const std::string &filename)
Definition file_util.cc:17
Definition common.cc:21