std::string vfsDevice::GetPs3Path(const std::string& l, const std::string& r) { if(l.empty()) return GetPs3Path(r, false); if(r.empty()) return GetPs3Path(l); return GetPs3Path(l + '/' + r, false); }
wxString vfsDevice::GetPs3Path(const wxString& l, const wxString& r) { if(l.IsEmpty()) return GetPs3Path(r, false); if(r.IsEmpty()) return GetPs3Path(l); return GetPs3Path(l + '/' + r, false); }
std::string vfsDevice::GetRootPs3(const std::string& path) { if(path.empty()) return ""; static const std::string home = "/dev_hdd0/game/"; u32 last_dir = 0; u32 first_dir = path.length() - 1; for(int i = path.length() - 1, dir = 0; i >= 0; --i) { if(path[i] == '\\' || path[i] == '/' || i == 0) { switch(dir++) { case 1: if(path.substr(i + 1, last_dir - i - 1) == "USRDIR") return ""; break; case 2: return GetPs3Path(home + path.substr(i + 1, last_dir - i - 1)); } last_dir = i; } } return GetPs3Path(home + path.substr(0, last_dir - 1)); }
wxString vfsDevice::GetRootPs3(const wxString& path) { if(path.IsEmpty()) return wxEmptyString; static const wxString& home = "/dev_hdd0/game/"; u32 last_dir = 0; u32 first_dir = path.Len() - 1; for(int i = path.Len() - 1, dir = 0; i >= 0; --i) { if(path[i] == '\\' || path[i] == '/' || i == 0) { switch(dir++) { case 1: if(!!path(i + 1, last_dir - i - 1).Cmp("USRDIR")) return wxEmptyString; break; case 2: return GetPs3Path(home + path(i + 1, last_dir - i - 1)); } last_dir = i; } } return GetPs3Path(home + path(0, last_dir - 1)); }