/*---------------------------------------------------------------------------* 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 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_ */