ctr_Repair/trunk/NetworkUpdater/sources/common/SaveDataMover.h
N2614 ad5225b6c5 ConsoleRestoreからNetworkUpdaterを作るためのブランチ作成
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@777 385bec56-5757-e545-9c3a-d8741f4650f1
2014-04-09 01:07:56 +00:00

93 lines
3.0 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:
//******************** 出力用API群 ********************
//! @brief 出力を準備します
void SetupExport();
//! @brief 出力するファイルサイズを計算します
void CalculateExportFileSize();
void CalculateExportSystemSaveDataSize();
void CalculateExportSharedExtSaveDataSize();
//! @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);
//******************** 入力用API群 ********************
//!@ brief 入力を準備します
void SetupImport(void* buf, size_t bufSize);
//! @brief システムセーブデータを入力します
void ImportSystemSaveData(void* buf, size_t bufSize, u64* progress);
//! @brief 共有拡張セーブデータを入力します
void ImportSharedExtSaveData(void* buf, size_t bufSize, u64* progress);
//! @brief 共有拡張セーブデータを出力します
nn::Result Import(void* buf, size_t bufSize, bit32 id, u64* progress);
//! @brief 入力するファイルサイズを計算します
void CalculateImportFileSize();
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_PADDING4;
nn::Result m_Result;
};
} /* namespace common */
#endif /* SAVEDATAMOVER_H_ */