mirror of
https://github.com/joel16/CMFileManager-PSP.git
synced 2024-11-23 11:49:51 +00:00
fs: Export function to get basename from path
This commit is contained in:
parent
48fa81e646
commit
f4130b20f2
@ -14,8 +14,8 @@ VERSION_MAJOR := 4
|
||||
VERSION_MINOR := 0
|
||||
VERSION_MICRO := 0
|
||||
|
||||
INCDIR = ../libs/include ../libs/include/ogg ../libs/include/opus include
|
||||
CFLAGS = -Os -G0 -Wall -ffast-math -fno-rtti -fno-exceptions -Wno-narrowing \
|
||||
INCDIR = ../libs/include ../libs/include/opus include
|
||||
CFLAGS = -Os -G0 -Wall -ffast-math -fno-rtti -fno-exceptions -Wno-narrowing -Wno-unused-variable \
|
||||
-DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_MICRO=$(VERSION_MICRO)
|
||||
CXXFLAGS = $(CFLAGS) -std=gnu++17
|
||||
ASFLAGS := $(CFLAGS)
|
||||
|
@ -35,6 +35,7 @@ namespace FS {
|
||||
int GetDirList(const std::string &path, std::vector<SceIoDirent> &entries);
|
||||
int ChangeDirNext(const std::string &path, std::vector<SceIoDirent> &entries);
|
||||
int ChangeDirPrev(std::vector<SceIoDirent> &entries);
|
||||
std::string GetFilename(const std::string &path);
|
||||
void Copy(SceIoDirent *entry, const std::string &path);
|
||||
int Paste(void);
|
||||
int Move(void);
|
||||
|
@ -267,6 +267,10 @@ namespace FS {
|
||||
|
||||
return FS::ChangeDir(parent_path.empty()? cfg.cwd : parent_path, entries);
|
||||
}
|
||||
|
||||
std::string GetFilename(const std::string &path) {
|
||||
return std::filesystem::path(path).filename().u8string();
|
||||
}
|
||||
|
||||
static int CopyFile(const std::string &src_path, const std::string &dest_path) {
|
||||
int ret = 0;
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <filesystem>
|
||||
#include <malloc.h>
|
||||
#include <pspiofilemgr.h>
|
||||
#include <pspthreadman.h>
|
||||
@ -344,7 +343,7 @@ namespace TextViewer {
|
||||
|
||||
std::string new_line = std::string();
|
||||
TEXT_VIEWER_STATE state = STATE_EDIT;
|
||||
std::string filename = std::filesystem::path(path.data()).filename();
|
||||
std::string filename = FS::GetFilename(path);
|
||||
|
||||
static int selection = 0;
|
||||
static const std::string prompt = "Do you wish to save your changes?";
|
||||
|
Loading…
Reference in New Issue
Block a user