ppsspp/ext/native/file/file_util.h
Henrik Rydgård 9e41fafd0d Move math and some file and data conversion files out from native to Common.
Buildfixing

Move some file util files

Buildfix

Move KeyMap.cpp/h to Core where they belong better.

libretro buildfix attempt

Move ini_file

More buildfixes
2020-10-04 09:12:46 +02:00

43 lines
1.2 KiB
C++

#pragma once
#include <string>
#include <vector>
#include <stdio.h>
#include <inttypes.h>
// Whole-file reading/writing
bool writeStringToFile(bool text_file, const std::string &str, const char *filename);
bool writeDataToFile(bool text_file, const void* data, const unsigned int size, const char *filename);
bool readFileToString(bool text_file, const char *filename, std::string &str);
// Return value must be delete[]-d.
uint8_t *ReadLocalFile(const char *filename, size_t *size);
// Beginnings of a directory utility system. TODO: Improve.
struct FileInfo {
std::string name;
std::string fullName;
bool exists;
bool isDirectory;
bool isWritable;
uint64_t size;
bool operator <(const FileInfo &other) const;
};
std::string getFileExtension(const std::string &fn);
bool getFileInfo(const char *path, FileInfo *fileInfo);
FILE *openCFile(const std::string &filename, const char *mode);
enum {
GETFILES_GETHIDDEN = 1
};
size_t getFilesInDir(const char *directory, std::vector<FileInfo> *files, const char *filter = nullptr, int flags = 0);
int64_t getDirectoryRecursiveSize(const std::string &path, const char *filter = nullptr, int flags = 0);
#ifdef _WIN32
std::vector<std::string> getWindowsDrives();
#endif