1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     fs_Api.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 30789 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_FS_FS_API_H_
17 #define NN_FS_FS_API_H_
18 
19 #include <nn/Result.h>
20 #include <nn/os.h>
21 
22 namespace nn {
23 namespace fs {
24 
25 //----------------------------------------
26 //! @name 初期化
27 //@{
28 
29 /*!
30     @brief fsライブラリを初期化します。
31 
32            fs ライブラリにあるクラスや関数を使うためには、先にこの関数を呼ぶ必要があります。
33 */
34 void  Initialize();
35 void  Finalize();
36 bool  IsInitialized();
37 
38 //@}
39 
40 //----------------------------------------
41 //! @name SD カード
42 //@{
43 
44 /*!
45     @brief SD カード挿入時にシグナルされる @ref nn::os::LightEvent を登録します。
46 
47     @param[in] p    SD カード挿入時にシグナルされる @ref nn::os::LightEvent を指定します。
48     @return         なし。
49 */
50 void RegisterSdmcInsertedEvent(nn::os::LightEvent* p);
51 
52 /*!
53     @brief @ref nn::fs::RegisterSdmcInsertedEvent の登録を解除します。
54 
55     @return         なし。
56 */
57 void UnregisterSdmcInsertedEvent();
58 
59 /*!
60     @brief SD カード取り出し時にシグナルされる @ref nn::os::LightEvent を登録します。
61 
62     @param[in] p    SD カード取り出し時にシグナルされる @ref nn::os::LightEvent を指定します。
63     @return         なし。
64 */
65 void RegisterSdmcEjectedEvent(nn::os::LightEvent* p);
66 
67 /*!
68     @brief @ref nn::fs::RegisterSdmcEjectedEvent の登録を解除します。
69 
70     @return         なし。
71 */
72 void UnregisterSdmcEjectedEvent();
73 
74 /*!
75     @brief SD カードが挿入されているかを返します。
76 
77             本関数は高負荷のため、SD カード挿入イベントや取り出しイベントを待つ場合は、
78             @ref nn::fs::RegisterSdmcInsertedEvent, @ref nn::fs::RegisterSdmcEjectedEvent 関数で登録した
79             @ref nn::os::LightEvent を使用してください。
80 
81     @return         挿入されていれば true を、挿入されていなければ false を返します。
82 */
83 bool IsSdmcInserted();
84 
85 /*!
86     @brief SD カードが書き込み可能かを返します。
87 
88             SD カードが書き込み可能である状態とは、SD カードが挿入されており、
89             かつ、SD カードが LOCK スイッチにより書き込み禁止されていない状態です。
90 
91     @return         書き込み可能であれば true を、書き込み不可能であれば false を返します。
92 */
93 bool IsSdmcWritable();
94 
95 //@}
96 
97 }
98 }
99 
100 #endif /* NN_FS_FS_API_H_ */
101