2016-12-10 15:32:03 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
// move / copy flags
|
2017-02-22 23:27:34 +01:00
|
|
|
#define OVERRIDE_PERM (1UL<<0)
|
2017-06-09 16:21:41 +02:00
|
|
|
#define NO_CANCEL (1UL<<1)
|
2017-06-09 01:45:00 +02:00
|
|
|
#define SILENT (1UL<<2)
|
|
|
|
#define CALC_SHA (1UL<<3)
|
|
|
|
#define BUILD_PATH (1UL<<4)
|
|
|
|
#define ASK_ALL (1UL<<5)
|
|
|
|
#define SKIP_ALL (1UL<<6)
|
|
|
|
#define OVERWRITE_ALL (1UL<<7)
|
2016-12-10 15:32:03 +01:00
|
|
|
|
|
|
|
/** Return total size of SD card **/
|
|
|
|
uint64_t GetSDCardSize();
|
|
|
|
|
|
|
|
/** Format the SD card **/
|
2017-01-18 18:07:12 +01:00
|
|
|
bool FormatSDCard(u64 hidden_mb, u32 cluster_size, const char* label);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
2017-02-20 19:58:36 +01:00
|
|
|
/** Format the bonus drive area **/
|
|
|
|
bool SetupBonusDrive(void);
|
|
|
|
|
2016-12-13 17:10:39 +01:00
|
|
|
/** Check for file lock, offer to unlock if possible **/
|
|
|
|
bool FileUnlock(const char* path);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
|
|
|
/** Create / open file and write the provided data to it **/
|
2017-06-26 01:44:16 +02:00
|
|
|
bool FileSetData(const char* path, const void* data, size_t size, size_t foffset, bool create);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
|
|
|
/** Read data from file@offset **/
|
2017-06-26 01:44:16 +02:00
|
|
|
size_t FileGetData(const char* path, void* data, size_t size, size_t foffset);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
|
|
|
/** Get size of file **/
|
|
|
|
size_t FileGetSize(const char* path);
|
|
|
|
|
|
|
|
/** Get SHA-256 of file **/
|
|
|
|
bool FileGetSha256(const char* path, u8* sha256);
|
|
|
|
|
|
|
|
/** Find data in file **/
|
2016-12-11 15:40:44 +01:00
|
|
|
u32 FileFindData(const char* path, u8* data, u32 size_data, u32 offset_file);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
|
|
|
/** Inject file into file @offset **/
|
2017-06-09 01:45:00 +02:00
|
|
|
bool FileInjectFile(const char* dest, const char* orig, u64 off_dest, u64 off_orig, u64 size, u32* flags);
|
2016-12-10 15:32:03 +01:00
|
|
|
|
2017-02-28 16:46:24 +01:00
|
|
|
/** Create a new directory in cpath **/
|
|
|
|
bool DirCreate(const char* cpath, const char* dirname);
|
|
|
|
|
|
|
|
/** Get # of files, subdirs and total size for directory **/
|
|
|
|
bool DirInfo(const char* path, u64* tsize, u32* tdirs, u32* tfiles);
|
|
|
|
|
2017-06-21 01:04:36 +02:00
|
|
|
/** True if path exists **/
|
|
|
|
bool PathExist(const char* path);
|
|
|
|
|
2017-06-09 16:21:41 +02:00
|
|
|
/** Direct recursive move / copy of files or directories **/
|
|
|
|
bool PathMoveCopy(const char* dest, const char* orig, u32* flags, bool move);
|
|
|
|
|
2016-12-10 15:32:03 +01:00
|
|
|
/** Recursively copy a file or directory **/
|
|
|
|
bool PathCopy(const char* destdir, const char* orig, u32* flags);
|
|
|
|
|
|
|
|
/** Recursively move a file or directory **/
|
|
|
|
bool PathMove(const char* destdir, const char* orig, u32* flags);
|
|
|
|
|
|
|
|
/** Recursively delete a file or directory **/
|
|
|
|
bool PathDelete(const char* path);
|
|
|
|
|
|
|
|
/** Rename file / folder in path to new name **/
|
|
|
|
bool PathRename(const char* path, const char* newname);
|
|
|
|
|
2017-06-21 01:04:36 +02:00
|
|
|
/** Select a file **/
|
|
|
|
bool FileSelector(char* result, const char* text, const char* path, const char* pattern, bool hide_ext, bool no_dirs);
|
|
|
|
|
2016-12-10 15:32:03 +01:00
|
|
|
/** Create a screenshot of the current framebuffer **/
|
|
|
|
void CreateScreenshot();
|