Commit f544ac68 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Remove VirtualFS::create_missing_dirs

parent 5dd61861
Pipeline #44228 passed with stage
in 1 minute and 50 seconds
......@@ -118,64 +118,5 @@ std::string VirtualFS::eval_fip(const std::string& dir_path, const std::string&
return dir_path + preferred_path_separator + rel_path;
}
void VirtualFS::create_missing_dirs(const std::string& file_path)
{
size_t make_spos;
//
//
//
{
bool prev_was_psep = false;
size_t last_notpsep_pos = file_path.size();
for(size_t i = file_path.size(); i != SIZE_MAX; i--)
{
if(is_path_separator(file_path[i]))
prev_was_psep = true;
else
{
if(prev_was_psep)
{
std::string tmp = file_path.substr(0, i + 1);
if(finfo(tmp, nullptr, false))
break;
}
prev_was_psep = false;
last_notpsep_pos = i;
}
}
make_spos = last_notpsep_pos;
}
//
//
//
{
bool prev_was_psep = false;
for(size_t i = make_spos; i < file_path.size(); i++)
{
if(is_path_separator(file_path[i]))
{
if(!prev_was_psep)
{
std::string tmp = file_path.substr(0, i);
mkdir(tmp, false);
//puts(tmp.c_str());
}
prev_was_psep = true;
}
else
prev_was_psep = false;
}
}
}
}
......@@ -115,9 +115,6 @@ class VirtualFS
INLINE char get_preferred_path_separator(void) { return preferred_path_separator; }
// Create any directories needed to create a file at file_path
void create_missing_dirs(const std::string& file_path);
protected:
const char preferred_path_separator;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment