2018-06-10 18:11:05 +01:00
|
|
|
#pragma once
|
|
|
|
#include <switch.h>
|
|
|
|
#include <stratosphere.hpp>
|
|
|
|
|
|
|
|
class Utils {
|
|
|
|
public:
|
2018-06-15 00:50:01 +01:00
|
|
|
static bool IsSdInitialized();
|
2018-06-10 18:11:05 +01:00
|
|
|
static Result OpenSdFile(const char *fn, int flags, FsFile *out);
|
2018-06-15 00:50:01 +01:00
|
|
|
static Result OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenRomFSSdFile(u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenSdDir(const char *path, FsDir *out);
|
|
|
|
static Result OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out);
|
|
|
|
static Result OpenRomFSSdDir(u64 title_id, const char *path, FsDir *out);
|
|
|
|
|
|
|
|
|
|
|
|
static Result OpenRomFSFile(FsFileSystem *fs, u64 title_id, const char *fn, int flags, FsFile *out);
|
|
|
|
static Result OpenRomFSDir(FsFileSystem *fs, u64 title_id, const char *path, FsDir *out);
|
2018-07-28 04:15:06 +01:00
|
|
|
|
|
|
|
static Result HasSdRomfsContent(u64 title_id, bool *out);
|
2018-07-28 20:29:54 +01:00
|
|
|
|
|
|
|
/* SD card Initialization + MitM detection. */
|
|
|
|
static void InitializeSdThreadFunc(void *args);
|
|
|
|
static bool HasSdMitMFlag(u64 tid);
|
2018-06-10 18:11:05 +01:00
|
|
|
};
|