2008-09-07 10:29:46 +00:00
|
|
|
// Copyright (C) 2003-2008 Dolphin Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// Official SVN repository and contact information can be found at
|
|
|
|
// http://code.google.com/p/dolphin-emu/
|
|
|
|
|
2008-07-16 20:50:16 +00:00
|
|
|
#ifndef _FILEUTIL_H
|
|
|
|
#define _FILEUTIL_H
|
|
|
|
|
|
|
|
#include <string>
|
2008-09-23 23:27:38 +00:00
|
|
|
#include <vector>
|
2008-07-16 20:50:16 +00:00
|
|
|
|
2008-09-22 19:48:12 +00:00
|
|
|
#include "Common.h"
|
|
|
|
|
2008-09-23 22:23:38 +00:00
|
|
|
namespace File
|
2008-07-16 20:50:16 +00:00
|
|
|
{
|
2008-09-23 22:23:38 +00:00
|
|
|
|
2008-09-23 23:27:38 +00:00
|
|
|
struct FSTEntry
|
|
|
|
{
|
|
|
|
bool isDirectory;
|
|
|
|
u32 size; // file length or number of entries from children
|
|
|
|
std::string physicalName; // name on disk
|
|
|
|
std::string virtualName; // name in FST names table
|
|
|
|
std::vector<FSTEntry> children;
|
|
|
|
};
|
|
|
|
|
2008-11-01 15:59:06 +00:00
|
|
|
std::string SanitizePath(const char *filename);
|
2008-09-23 22:23:38 +00:00
|
|
|
bool Exists(const char *filename);
|
|
|
|
void Launch(const char *filename);
|
|
|
|
void Explore(const char *path);
|
|
|
|
bool IsDirectory(const char *filename);
|
|
|
|
bool CreateDir(const char *filename);
|
|
|
|
bool Delete(const char *filename);
|
2008-11-02 14:43:22 +00:00
|
|
|
bool DeleteDir(const char *filename);
|
2008-09-23 22:23:38 +00:00
|
|
|
u64 GetSize(const char *filename);
|
|
|
|
std::string GetUserDirectory();
|
2008-11-01 15:59:06 +00:00
|
|
|
bool CreateEmptyFile(const char *filename);
|
2008-09-23 22:23:38 +00:00
|
|
|
|
2008-09-23 23:27:38 +00:00
|
|
|
u32 ScanDirectoryTree(const std::string& _Directory, FSTEntry& parentEntry);
|
|
|
|
|
2008-11-02 14:43:22 +00:00
|
|
|
bool DeleteDirRecursively(const std::string& _Directory);
|
|
|
|
|
2008-09-23 22:23:38 +00:00
|
|
|
} // namespace
|
2008-07-16 20:50:16 +00:00
|
|
|
|
|
|
|
#endif
|