1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_GroupFileReader.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_SND_GROUP_FILE_READER_H_
19 #define NW_SND_GROUP_FILE_READER_H_
20 
21 #include <nw/snd/snd_GroupFile.h>
22 
23 namespace nw {
24 namespace snd {
25 namespace internal {
26 
27 struct GroupItemLocationInfo
28 {
29     u32 fileId;
30     const void* address;    // 非 NULL: 埋め込みアイテム。ロードされたアドレスを格納。
31                             // NULL   : リンクアイテム。別途ロードが必要。
32 };
33 
34 class GroupFileReader
35 {
36 public:
37     static const u32 SIGNATURE_FILE = NW_UT_MAKE_SIGWORD( 'C', 'G', 'R', 'P' );
38 
39     GroupFileReader( const void* groupFile );
40 
41     // InfoBlock の情報を取得
GetGroupItemCount()42     u32 GetGroupItemCount() const { return m_pInfoBlockBody->GetGroupItemInfoCount(); }
43     bool ReadGroupItemLocationInfo( GroupItemLocationInfo* out, u32 index ) const;
44 
45     // InfoExBlock の情報を取得
46     u32 GetGroupItemExCount() const;
47     bool ReadGroupItemInfoEx( GroupFile::GroupItemInfoEx* out, u32 index ) const;
48 
49 private:
50     const GroupFile::InfoBlockBody* m_pInfoBlockBody;
51     const GroupFile::FileBlockBody* m_pFileBlockBody;
52     const GroupFile::InfoExBlockBody* m_pInfoExBlockBody;
53 };
54 
55 } // namespace nw::snd::internal
56 } // namespace nw::snd
57 } // namespace nw
58 
59 
60 #endif /* NW_SND_GROUP_FILE_READER_H_ */
61 
62