ctr_Repair/trunk/CardSaveDataMover/body/source/savefile/savedata.h

67 lines
1.7 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 SAVEDATA_H_
#define SAVEDATA_H_
#include <nn/types.h>
#include <nn/Result.h>
//#include <nn/am/am_ApiSystemMenu.h>
#include "../my_defs.h"
#include "savefile.h"
#define MAX_PATH_LENGTH 512
class SaveData
{
public:
s64 FileSize;
nn::Result LastNnResult;
char PrdCode[20];
private:
nn::fs::FileReader reader;
nn::fs::FileWriter writer;
int s_lv;
wchar_t *pPathTop;
tArcInfo m_info;
bool s_serch;
u8 pad[3];//padding
public:
SaveData();
~SaveData();
myResult Mount();
void Unmount();
myResult GetPath(wchar_t *path);
void ResetPath();
bool Open(wchar_t *path);
void Finalize();
void Close();
void CloseW();
s32 Read(char *buffer,size_t size);
myResult IsExist();
bool GetInfo(tArcInfo *pinfo);
myResult Format(tArcInfo *pinfo);
bool OpenW(wchar_t *path,s64 size,bool *mkdir);
s32 Write(char *buffer,size_t size);
bool Commit();
bool GetPrdCode();
#ifdef USE_SYS_SAVE
void Delete();
#endif
};
#endif