ctr_Repair/trunk/CardSaveData/common/savefile/sdmc.h

82 lines
2.2 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: irp.h
Copyright (C)2009 Nintendo Co., Ltd. All rights reserved.
These coded instructions, statements, and computer programs contain
proprietary information of Nintendo of America Inc. and/or Nintendo
Company Ltd., and are protected by Federal copyright law. They may
not be disclosed to third parties or copied or duplicated in any form,
in whole or in part, without the prior written consent of Nintendo.
$Rev$
*---------------------------------------------------------------------------*/
#ifndef sdmc_H_
#define sdmc_H_
#include <sstream>
#include <nn/types.h>
#include <nn/Result.h>
#include "../my_defs.h"
#include "savefile.h"
class Sdmc
{
public:
s64 FileSize;
nn::Result LastNnResult;
//std::wstring DateDirName;
char DirName[16];
private:
std::wstring GetDateName();
std::wstring DateDirName;
nn::fs::FileReader reader;
nn::fs::FileWriter writer;
//wchar_t *pPathTop;
tArcInfo m_info;
//int s_lv;
int exrootlen;
//bool s_serch;
public:
Sdmc();
~Sdmc();
void Finalize();
bool Create();
myResult Mount();
myResult MountSys();
void Unmount();
bool Delete();
bool DeleteAll();
void CloseW();
//bool OpenW(wchar_t *path,s64 size);
bool OpenW(wchar_t *path,s64 size,bool *mkdir);
bool OpenVnfW(wchar_t *path,s64 size);
bool OpenVnf(wchar_t *path);
void GetRootPath(wchar_t *path);
// bool OpenSysW();//暫定
// void CloseSysW();//暫定
// bool OpenSysR();//暫定
// void CloseSysR();//暫定
s32 Write(char *buffer,size_t size);
bool WriteSys(tArcInfo *ifo);
// bool ReadSys(tArcInfo *pinfo);
//void ResetPath();
s32 Read(char *buffer,size_t size);
void Close();
bool Open(wchar_t *path);
//myResult GetPath(wchar_t *path);
bool GetInfo(tArcInfo *pinfo);
};
//Fat違反パス格納データのヘッダ
//直後にデータ配置
//Header+Data,、Header+Data ... と連続して追記してゆく
typedef struct{
wchar_t path[MAX_PATH_LENGTH];
s64 size;
}tVnf;
#endif