25 #ifndef AURORA_GFF3FILE_H 26 #define AURORA_GFF3FILE_H 31 #include <boost/noncopyable.hpp> 42 class SeekableReadStream;
227 float &x,
float &y,
float &z )
const;
229 float &a,
float &b,
float &c,
float &d)
const;
232 double &x,
double &y,
double &z )
const;
234 double &a,
double &b,
double &c,
double &d)
const;
279 std::vector<uint32> &indices,
uint32 count)
const;
299 #endif // AURORA_GFF3FILE_H Header _header
The GFF3's header.
int64 getSint(const Common::UString &field, int64 def=0) const
std::vector< GFF3List > ListArray
bool _repairNWNPremium
Should we try to read GFF3 files found in Neverwinter Nights premium modules?
std::vector< uint32 > _listOffsetToIndex
To convert list offsets found in GFF3 to real indices.
const GFF3List & getList(uint32 i) const
Return a list within the GFF3.
bool getBool(const Common::UString &field, bool def=false) const
bool getLocString(const Common::UString &field, LocString &str) const
void readFields(Common::SeekableReadStream &data, uint32 index, uint32 count)
A class holding an UTF-8 string.
void loadHeader(uint32 id)
const GFF3Struct & getStruct(uint32 i) const
Return a struct within the GFF3.
uint32 _fieldIndex
Field / Field indices index.
uint32 getID() const
Return the struct's ID.
const GFF3File * _parent
The parent GFF3.
bool hasField(const Common::UString &field) const
Does this specific field exist?
String reference, index into a talk table.
void getOrientation(const Common::UString &field, float &a, float &b, float &c, float &d) const
StructArray _structs
Our structs.
char getChar(const Common::UString &field, char def='\0') const
const GFF3Struct & getTopLevel() const
Returns the top-level struct.
std::map< Common::UString, Field > FieldMap
uint64 getUint(const Common::UString &field, uint64 def=0) const
FieldType getFieldType(const Common::UString &field) const
Return the type of this field, or kFieldTypeNone if such a field doesn't exist.
FieldType type
Type of the field.
FieldMap _fields
The fields, indexed by their label.
uint32 data
Data of the field.
FieldType
The type of a GFF3 field.
A simple scoped smart pointer template.
Common::SeekableReadStream & getStream(uint32 offset) const
Return the GFF3 stream.
void getVector(const Common::UString &field, float &x, float &y, float &z) const
Random data of variable length.
double getDouble(const Common::UString &field, double def=0.0) const
Base for BioWare's Aurora engine files.
static void destroy(T *x)
A GFF (generic file format) V3.2/V3.3 file, found in all Aurora games except Sonic Chronicles: The Da...
Low-level type definitions to handle fixed width types portably.
A vector storing pointer to objects, with automatic deletion.
uint32 _fieldCount
Field count.
uint32 getType() const
Return the GFF3's specific type.
std::vector< const GFF3Struct * > GFF3List
uint32 _id
The struct's ID.
uint32 _offsetCorrection
The correctional value for offsets to repair Neverwinter Nights premium modules.
Basic type definitions to handle files used in BioWare's Aurora engine.
ListArray _lists
Our lists.
const GFF3List & getList(const Common::UString &field) const
Common::PtrVector< GFF3Struct > StructArray
Common::SeekableReadStream & getFieldData() const
Return the GFF3 stream seeked to the start of the field data.
A field in the GFF3 struct.
std::vector< Common::UString > _fieldNames
The names of all fields in this struct.
Resource reference, string.
const GFF3Struct & getStruct(const Common::UString &field) const
size_t getFieldCount() const
Return the number of fields in this struct.
Base class for most files found in games using BioWare's Aurora engine.
FileType
Various file types used by the Aurora engine and found in archives.
Common::SeekableReadStream * getData(const Common::UString &field) const
GFF3Struct(const GFF3File &parent, uint32 offset)
Common::ScopedPtr< Common::SeekableReadStream > _stream
List containing a number of structs.
Common::UString getString(const Common::UString &field, const Common::UString &def="") const
Struct containing a number of fields.
void readIndices(Common::SeekableReadStream &data, std::vector< uint32 > &indices, uint32 count) const
GFF3File(Common::SeekableReadStream *gff3, uint32 id=0xFFFFFFFF, bool repairNWNPremium=false)
Take over this stream and read a GFF3 file out of it.
void readField(Common::SeekableReadStream &data, uint32 index)
bool extended
Does this field need extended data?
Interface for a seekable & readable data stream.
const Field * getField(const Common::UString &name) const
Returns the field with this tag.
const std::vector< Common::UString > & getFieldNames() const
Return a list of all field names in this struct.
Common::UString readLabel(Common::SeekableReadStream &data, uint32 index) const