Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Suyu
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Suyu
Commits
e83de18f
There was an error fetching the commit references. Please try again later.
Commit
e83de18f
authored
11 years ago
by
ShizZy
Browse files
Options
Downloads
Patches
Plain Diff
removed unused commented-out code
parent
59020e8d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core/src/file_sys/file_sys_directory.cpp
+0
-154
0 additions, 154 deletions
src/core/src/file_sys/file_sys_directory.cpp
with
0 additions
and
154 deletions
src/core/src/file_sys/file_sys_directory.cpp
+
0
−
154
View file @
e83de18f
...
...
@@ -669,157 +669,3 @@ void DirectoryFileSystem::DoState(PointerWrap &p) {
ERROR_LOG
(
FILESYS
,
"FIXME: Open files during savestate, could go badly."
);
}
}
/*
VFSFileSystem::VFSFileSystem(IHandleAllocator *_hAlloc, std::string _basePath) : basePath(_basePath) {
INFO_LOG(FILESYS, "Creating VFS file system");
hAlloc = _hAlloc;
}
VFSFileSystem::~VFSFileSystem() {
for (auto iter = entries.begin(); iter != entries.end(); ++iter) {
delete [] iter->second.fileData;
}
entries.clear();
}
std::string VFSFileSystem::GetLocalPath(std::string localPath) {
return basePath + localPath;
}
bool VFSFileSystem::MkDir(const std::string &dirname) {
// NOT SUPPORTED - READ ONLY
return false;
}
bool VFSFileSystem::RmDir(const std::string &dirname) {
// NOT SUPPORTED - READ ONLY
return false;
}
int VFSFileSystem::RenameFile(const std::string &from, const std::string &to) {
// NOT SUPPORTED - READ ONLY
return -1;
}
bool VFSFileSystem::RemoveFile(const std::string &filename) {
// NOT SUPPORTED - READ ONLY
return false;
}
u32 VFSFileSystem::OpenFile(std::string filename, FileAccess access, const char *devicename) {
if (access != FILEACCESS_READ) {
ERROR_LOG(FILESYS, "VFSFileSystem only supports plain reading");
return 0;
}
std::string fullName = GetLocalPath(filename);
const char *fullNameC = fullName.c_str();
INFO_LOG(FILESYS,"VFSFileSystem actually opening %s (%s)", fullNameC, filename.c_str());
size_t size;
u8 *data = VFSReadFile(fullNameC, &size);
if (!data) {
ERROR_LOG(FILESYS, "VFSFileSystem failed to open %s", filename.c_str());
return 0;
}
OpenFileEntry entry;
entry.fileData = data;
entry.size = size;
entry.seekPos = 0;
u32 newHandle = hAlloc->GetNewHandle();
entries[newHandle] = entry;
return newHandle;
}
FileInfo VFSFileSystem::GetFileInfo(std::string filename) {
FileInfo x;
x.name = filename;
std::string fullName = GetLocalPath(filename);
INFO_LOG(FILESYS,"Getting VFS file info %s (%s)", fullName.c_str(), filename.c_str());
FileInfo fo;
VFSGetFileInfo(fullName.c_str(), &fo);
x.exists = fo.exists;
if (x.exists) {
x.size = fo.size;
x.type = fo.isDirectory ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
}
INFO_LOG(FILESYS,"Got VFS file info: size = %i", (int)x.size);
return x;
}
void VFSFileSystem::CloseFile(u32 handle) {
EntryMap::iterator iter = entries.find(handle);
if (iter != entries.end()) {
delete [] iter->second.fileData;
entries.erase(iter);
} else {
//This shouldn't happen...
ERROR_LOG(FILESYS,"Cannot close file that hasn't been opened: %08x", handle);
}
}
bool VFSFileSystem::OwnsHandle(u32 handle) {
EntryMap::iterator iter = entries.find(handle);
return (iter != entries.end());
}
size_t VFSFileSystem::ReadFile(u32 handle, u8 *pointer, s64 size) {
INFO_LOG(FILESYS,"VFSFileSystem::ReadFile %08x %p %i", handle, pointer, (u32)size);
EntryMap::iterator iter = entries.find(handle);
if (iter != entries.end())
{
size_t bytesRead = size;
memcpy(pointer, iter->second.fileData + iter->second.seekPos, size);
iter->second.seekPos += size;
return bytesRead;
} else {
ERROR_LOG(FILESYS,"Cannot read file that hasn't been opened: %08x", handle);
return 0;
}
}
size_t VFSFileSystem::WriteFile(u32 handle, const u8 *pointer, s64 size) {
// NOT SUPPORTED - READ ONLY
return 0;
}
size_t VFSFileSystem::SeekFile(u32 handle, s32 position, FileMove type) {
EntryMap::iterator iter = entries.find(handle);
if (iter != entries.end()) {
switch (type) {
case FILEMOVE_BEGIN: iter->second.seekPos = position; break;
case FILEMOVE_CURRENT: iter->second.seekPos += position; break;
case FILEMOVE_END: iter->second.seekPos = iter->second.size + position; break;
}
return iter->second.seekPos;
} else {
//This shouldn't happen...
ERROR_LOG(FILESYS,"Cannot seek in file that hasn't been opened: %08x", handle);
return 0;
}
}
bool VFSFileSystem::GetHostPath(const std::string &inpath, std::string &outpath) {
// NOT SUPPORTED
return false;
}
std::vector<FileInfo> VFSFileSystem::GetDirListing(std::string path) {
std::vector<FileInfo> myVector;
// TODO
return myVector;
}
void VFSFileSystem::DoState(PointerWrap &p) {
if (!entries.empty()) {
p.SetError(p.ERROR_WARNING);
ERROR_LOG(FILESYS, "FIXME: Open files during savestate, could go badly.");
}
}
*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment