Bring back fsMakePath
This commit is contained in:
parent
083e89628e
commit
b96697f7a4
@ -221,7 +221,7 @@ typedef struct
|
||||
{
|
||||
FS_PathType type; ///< FS path type.
|
||||
u32 size; ///< FS path size.
|
||||
const u8* data; ///< Pointer to FS path data.
|
||||
const void* data; ///< Pointer to FS path data.
|
||||
} FS_Path;
|
||||
|
||||
/// FS archive.
|
||||
@ -238,6 +238,14 @@ Result fsInit(void);
|
||||
/// Exits FS.
|
||||
void fsExit(void);
|
||||
|
||||
/**
|
||||
* Creates an FS_Path instance.
|
||||
* @param type Type of path.
|
||||
* @param path Path to use.
|
||||
* @return The created FS_Path instance.
|
||||
*/
|
||||
FS_Path fsMakePath(FS_PathType type, const void* path);
|
||||
|
||||
/**
|
||||
* @brief Gets the current FS session handle.
|
||||
* @return The current FS session handle.
|
||||
|
@ -36,6 +36,30 @@ void fsExit(void)
|
||||
svcCloseHandle(fsuHandle);
|
||||
}
|
||||
|
||||
FS_Path fsMakePath(FS_PathType type, const void* path)
|
||||
{
|
||||
FS_Path p = { type, 0, path };
|
||||
switch (type)
|
||||
{
|
||||
case PATH_ASCII:
|
||||
p.size = strlen((const char*)path)+1;
|
||||
break;
|
||||
case PATH_UTF16:
|
||||
{
|
||||
const u16* str = (const u16*)path;
|
||||
while (*str++) p.size++;
|
||||
p.size++;
|
||||
break;
|
||||
}
|
||||
case PATH_EMPTY:
|
||||
p.size = 1;
|
||||
p.data = "";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
Handle* fsGetSessionHandle(void)
|
||||
{
|
||||
return &fsuHandle;
|
||||
|
Loading…
Reference in New Issue
Block a user