/*---------------------------------------------------------------------------* Project: Horizon File: hio_Api.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: 26495 $ *---------------------------------------------------------------------------*/ #ifndef NN_HIO_CTR_HIO_API_H_ #define NN_HIO_CTR_HIO_API_H_ #ifdef NN_SWITCH_ENABLE_HOST_IO /*! @file @brief HIO ライブラリの初期化、終了、バージョン取得、ファイル操作を行う API です。 */ #include #include namespace nn { namespace hio { namespace CTR { //! チャンネルオープンに必要なワークメモリのサイズ const size_t WORKMEMORY_SIZE = (80 * 1024 + 32); //! 最大チャンネル数 const size_t MAX_CHANNEL_NUM = 12; /*! @name Initialize/Finalize @{ */ /*! @brief HIO ライブラリの初期化処理を行います。ライブラリ利用前に一度呼び出す必要があります。 @param[in] pDeviceMemory ライブラリが使用するワークメモリを指定します。ワークメモリは デバイス用のメモリ である必要があり、サイズは @ref WORKMEMORY_SIZE です。 @return 処理の結果が返ってきます。 デバイス用のメモリ領域は、@ref nn::os::GetDeviceMemoryAddress で取得できます。 */ Result Initialize(void* pDeviceMemory); /*! @brief HIO ライブラリの終了処理を行います。ライブラリ利用後に一度呼び出す必要があります。 @return 処理の結果が返ってきます。 */ Result Finalize(); /*! @} */ /*! @brief HIO ライブラリのバージョンを取得します。 @return HIO ライブラリのバージョン。 */ s32 GetVersion(); /*! :overload nounicode @brief ファイルを削除します。 @param[in] path ファイル名のパス。 @return 処理の結果を返します。 */ Result DeleteFile(const char* path); /*! :overload unicode @brief ファイルを削除します。 @param[in] path ファイル名のパス。 @return 処理の結果を返します。 */ Result DeleteFile(const wchar_t* path); /*! :overload unicode @brief ディレクトリを削除します。 ディレクトリが空でない場合失敗します。 @param[in] path ディレクトリのパス。 @return 処理の結果を返します。 */ Result DeleteDirectory(const wchar_t* path); /*! :overload nounicode @brief ディレクトリを削除します。 ディレクトリが空でない場合失敗します。 @param[in] path ディレクトリのパス。 @return 処理の結果を返します。 */ Result DeleteDirectory(const char* path); /*! :overload nounicode @brief ディレクトリを作成します。 @param[in] path ディレクトリのパス。 @return 処理の結果を返します。 */ Result CreateDirectory(const char* path); /*! :overload unicode @brief ディレクトリを作成します。 @param[in] path ディレクトリのパス。 @return 処理の結果を返します。 */ Result CreateDirectory(const wchar_t* path); /*! :overload nounicode @brief ファイル名、ディレクトリ名を変更します。 @param[in] newName 新しい名前。 @param[in] oldName 対象のファイル、ディレクトリのパス名。 @return 処理の結果を返します。 */ Result Rename(const char* newName, const char* oldName); /*! :overload unicode @brief ファイル名、ディレクトリ名を変更します。 @param[in] newName 新しい名前。 @param[in] oldName 対象のファイル、ディレクトリのパス名。 @return 処理の結果を返します。 */ Result Rename(const wchar_t* newName, const wchar_t* oldName); /*! :overload nounicode @brief カレントディレクトリを取得します。 @param[out] pLength 実際にコピーしたサイズの格納先。 @param[out] buf カレントディレクトリのパスを書き込むバッファ。 @param[in] length バッファサイズ。 @return 処理の結果を返します。 */ Result GetCurrentDirectory(s32* pLength, char* buf, s32 length); /*! :overload unicode @brief カレントディレクトリを取得します。 @param[out] pLength 実際にコピーしたサイズの格納先。 @param[out] buf カレントディレクトリのパスを書き込むバッファ。 @param[in] length バッファサイズ。 @return 処理の結果を返します。 */ Result GetCurrentDirectory(s32* pLength, wchar_t* buf, s32 length); /*! :overload nounicode @brief カレントディレクトリを取得します。 @param[out] buf カレントディレクトリのパスを書き込むバッファ。 @param[in] length バッファサイズ。 @return 実際にコピーしたサイズを返します。エラーが発生した場合は -1 を返します。 */ s32 GetCurrentDirectory(char* buf, s32 length); /*! :overload unicode @brief カレントディレクトリを取得します。 @param[out] buf カレントディレクトリのパスを書き込むバッファ。 @param[in] length バッファサイズ。 @return 実際にコピーしたサイズを返します。エラーが発生した場合は -1 を返します。 */ s32 GetCurrentDirectory(wchar_t* buf, s32 length); /*! :overload nounicode @brief カレントディレクトリを設定します。 @param[in] path カレントディレクトリとして設定するパスが格納されているバッファ。 @return 処理の結果を返します。 */ Result SetCurrentDirectory(const char* path); /*! :overload unicode @brief カレントディレクトリを設定します。 @param[in] path カレントディレクトリとして設定するパスが格納されているバッファ。 @return 処理の結果を返します。 */ Result SetCurrentDirectory(const wchar_t* path); /*! :overload nounicode_withresult @brief 環境変数を取得します。 @param[out] pLength 実際にコピーしたサイズの格納先。 @param[out] buf 環境変数の値を格納するバッファ。 @param[in] length バッファサイズ。 @param[in] name 環境変数名。 @return 処理の結果を返します。 */ Result GetEnvironmentVariable(s32* pLength, char* buf, s32 length, const char* name); /*! :overload nounicode_noresult @brief 環境変数を取得します。 @param[out] buf 環境変数の値を格納するバッファ。 @param[in] length バッファサイズ。 @param[in] name 環境変数名。 @return 実際にコピーしたサイズを返します。エラーが発生した場合は -1 を返します。 */ s32 GetEnvironmentVariable(char* buf, size_t length, const char* name); /*! :overload unicode_withresult @brief 環境変数を取得します。 @param[out] buf 環境変数の値を格納するバッファ。 @param[in] length バッファサイズ。 @param[in] name 環境変数名。 @return 実際にコピーしたサイズを返します。エラーが発生した場合は -1 を返します。 */ Result GetEnvironmentVariable(s32* pLength, wchar_t* buf, s32 length, const wchar_t* name); /*! :overload unicode_noresult @brief 環境変数を取得します。 @param[out] buf 環境変数の値を格納するバッファ。 @param[in] length バッファサイズ。 @param[in] name 環境変数名。 @return 実際にコピーしたサイズを返します。エラーが発生した場合は -1 を返します。 */ s32 GetEnvironmentVariable(wchar_t* buf, s32 length, const wchar_t* name); } } } #endif // ifdef NN_SWITCH_ENABLE_HOST_IO #endif // ifndef NN_HIO_CTR_HIO_API_H_