ctr_Repair/trunk/ConsoleDataMigration/sources/common/SaveDataMover.h
N2614 dda865745d ファイルサイズ計算をFileTransferに移す
CARDBOARD用APIで共有拡張セーブデータを出力するように


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@475 385bec56-5757-e545-9c3a-d8741f4650f1
2011-11-02 08:52:15 +00:00

73 lines
2.3 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: SaveDataMover.h
Copyright (C)2011 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 SAVEDATAMOVER_H_
#define SAVEDATAMOVER_H_
#include <nn.h>
namespace common
{
class SaveDataMover
{
public:
SaveDataMover();
virtual ~SaveDataMover();
//! @brief SDカードへの出力を開始します
void StartExport(void* buf, size_t bufSize, u64* progress);
//! @brief SDカードからの入力を開始します
void StartImport(void* buf, size_t bufSize, u64* progress);
//! @brief 処理の結果を取得します
nn::Result GetLastResult();
private:
//! @brief 出力を準備します
void SetupExport();
//! @brief 出力するファイルサイズを計算します
void CalculateFileSize();
void CalculateSystemSaveDataSize();
void CalculateSharedExtSaveDataSize();
//! @brief システムセーブデータを出力します
void ExportSystemSaveData(void* buf, size_t bufSize, u64* progress);
//! @brief 共有拡張セーブデータを出力します
void ExportSharedExtSaveData(void* buf, size_t bufSize, u64* progress);
//! @breif 共有拡張セーブデータを出力します
nn::Result Export(void* buf, size_t bufSize, bit32 id, u64* progress);
nn::Result CopyFile(nn::fs::FileInputStream& is, nn::fs::FileOutputStream& os, void* pBuffer, const s32 bufferSize,
u64* progress);
nn::Result CopyRecursivly(void* buf, size_t bufSize, const char* src, const char* dest, u64* progress);
NN_PADDING4;
s64 m_Progress;
s64 m_FinishedSize;
s64 m_TotalSize;
nn::Result m_Result;
};
} /* namespace common */
#endif /* SAVEDATAMOVER_H_ */