xoreos  0.0.5
talktable_gff.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef AURORA_TALKTABLE_GFF_H
26 #define AURORA_TALKTABLE_GFF_H
27 
28 #include <map>
29 
30 #include "src/common/types.h"
31 #include "src/common/scopedptr.h"
32 #include "src/common/ptrmap.h"
33 #include "src/common/ustring.h"
34 
35 #include "src/aurora/types.h"
36 #include "src/aurora/talktable.h"
37 
38 namespace Common {
39  class SeekableReadStream;
40  class SeekableSubReadStreamEndian;
41 }
42 
43 namespace Aurora {
44 
60 class TalkTable_GFF : public TalkTable {
61 public:
65 
66  bool hasEntry(uint32 strRef) const;
67 
68  const Common::UString &getString (uint32 strRef) const;
69  const Common::UString &getSoundResRef(uint32 strRef) const;
70 
71  uint32 getSoundID(uint32 strRef) const;
72 
73 
74 private:
75  struct Entry {
77 
78  const GFF4Struct *strct;
79 
80  Entry(const GFF4Struct *s = 0) : strct(s) { }
81  };
82 
84 
85 
87 
88  mutable Entries _entries;
89 
91  void load02(const GFF4Struct &top);
92  void load05(const GFF4Struct &top);
93 
94  void readString(Entry &entry) const;
95  void readString02(Entry &entry) const;
96  void readString05(Entry &entry, bool bigEndian) const;
97 
99  Common::SeekableSubReadStreamEndian &bitStream, Entry &entry) const;
100 };
101 
102 } // End of namespace Aurora
103 
104 #endif // AURORA_TALKTABLE_GFF_H
void readString05(Entry &entry, bool bigEndian) const
This is a wrapper around SeekableSubReadStream, but it adds non-endian read methods whose endianness ...
Definition: readstream.h:383
Definition: 2dafile.h:39
A map storing pointer to objects, with automatic deletion.
A class holding an UTF-8 string.
Definition: ustring.h:48
Base class for BioWare&#39;s talk tables.
Definition: talktable.h:52
Loading BioWare&#39;s GFF&#39;d talk tables.
Definition: talktable_gff.h:60
uint32 getSoundID(uint32 strRef) const
TalkTable_GFF(Common::SeekableReadStream *tlk, Common::Encoding encoding)
Take over this stream and read a GFF&#39;d TLK out of it.
Common::PtrMap< uint32, Entry > Entries
Definition: talktable_gff.h:83
A simple scoped smart pointer template.
void load(Common::SeekableReadStream *tlk)
const GFF4Struct * strct
Definition: talktable_gff.h:78
Entry(const GFF4Struct *s=0)
Definition: talktable_gff.h:80
Encoding
Definition: encoding.h:37
const Common::UString & getString(uint32 strRef) const
Low-level type definitions to handle fixed width types portably.
Base class for BioWare&#39;s talk tables.
A scoped plain pointer, allowing pointer-y access and normal deletion.
Definition: scopedptr.h:120
void load02(const GFF4Struct &top)
Unicode string handling.
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
Common::ScopedPtr< GFF4File > _gff
Definition: talktable_gff.h:86
void readString(Entry &entry) const
const Common::UString & getSoundResRef(uint32 strRef) const
uint32_t uint32
Definition: types.h:204
bool hasEntry(uint32 strRef) const
void load05(const GFF4Struct &top)
void readString02(Entry &entry) const
Interface for a seekable & readable data stream.
Definition: readstream.h:265