ctr_Repair/trunk/ConsoleDataMigration/common/SdReaderWriter.h
N2614 5ed32bde66 本体データ移行ツールを追加
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@2 385bec56-5757-e545-9c3a-d8741f4650f1
2011-01-28 10:46:13 +00:00

65 lines
2.1 KiB
C++

/*---------------------------------------------------------------------------*
Project: Horizon
File: SdReaderWriter.h
Copyright 2009 Nintendo. 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 SDWRITER_H_
#define SDWRITER_H_
#include <nn.h>
namespace common
{
//! @brief SDカードに書き込むためのクラスです。
class SdReaderWriter
{
public :
SdReaderWriter() : m_IsInitialized(false) {};
~SdReaderWriter() {};
//! @brief 渡されたバッファからサイズ分指定されたパス名で書きこみます
//! @param[in] path sdmc:で始まる出力パス名。予めディレクトリを作っておく必要があります。
//! @param[in] buf 入力データへのポインタ
//! @param[in] size 入力データのサイズ
nn::Result WriteBuf(const wchar_t* path, void* buf, size_t size);
//! @brief 渡されたバッファへサイズ分指定されたパス名から読み込みます
//! @param[in] path sdmc:で始まる入力パス名
//! @param[in] buf 出力バッファへのポインタ
//! @param[in] size バッファサイズ
//! @param[out] totalSize 読み込んだデータのサイズ
nn::Result ReadBuf(const wchar_t* path, void* buf, size_t size, size_t* totalSize);
//! @brief 渡されたディレクトリ名のディレクトリを作成します
void CreateDirectory(const wchar_t* path);
private:
//! @brief 初期化します。
nn::Result Initialize();
//! @brief 終了します。
nn::Result Finalize();
nn::fs::FileStream file;
NN_PADDING3;
bool m_IsInitialized;
};
}
#endif /* SDWRITER_H_ */