25 #ifndef AURORA_GFF3WRITER_H 26 #define AURORA_GFF3WRITER_H 30 #include <boost/noncopyable.hpp> 31 #include <boost/shared_ptr.hpp> 33 #include "glm/glm.hpp" 40 class GFF3WriterStruct;
59 struct Field : boost::noncopyable {
88 std::vector<GFF3WriterListPtr>
_lists;
188 #endif // AURORA_GFF3WRITER_H Handling version V3.2/V3.3 of BioWare's GFFs (generic file format).
#define MKTAG(a0, a1, a2, a3)
A wrapper macro used around four character constants, like 'DATA', to ensure portability.
void addOrientation(const Common::UString &label, glm::vec4 value)
Add a new Orientation.
A class holding an UTF-8 string.
An implementation for a field.
GFF3WriterStruct(GFF3Writer *parent, uint32 id=0xFFFFFFFF)
boost::shared_ptr< Field > FieldPtr
GFF3WriterListPtr addList(const Common::UString &label)
Create a new list.
void addVoid(const Common::UString &label, const byte *data, uint32 size)
Add new void data.
size_t createField(GFF3Struct::FieldType type, const Common::UString &label)
Common::ScopedArray< byte > voidData
boost::shared_ptr< GFF3WriterStruct > GFF3WriterStructPtr
Common::UString stringValue
void addFloat(const Common::UString &label, float value)
Add a new float.
GFF3WriterList(GFF3Writer *parent)
void addChar(const Common::UString &label, char value)
Add a new char.
GFF3Struct::FieldType type
FieldType
The type of a GFF3 field.
void addResRef(const Common::UString &label, const Common::UString &value)
Add a new Resource reference.
std::vector< Common::UString > _labels
void addStrRef(const Common::UString &label, uint32 value)
Add a new String reference.
void addLocString(const Common::UString &label, const LocString &value)
Add a new LocString.
GFF3WriterStructPtr addStruct(const Common::UString &label)
Create a new struct.
GFF3WriterStructPtr addStruct(const Common::UString &label)
Add a new struct to the list.
void addExoString(const Common::UString &label, const Common::UString &value)
Add a new ExoString.
std::vector< size_t > _strcts
void addSint16(const Common::UString &label, int16 value)
Add a new sint16.
uint32 addLabel(const Common::UString &label)
Adds a label to the writer and returns the corresponding index.
void write(Common::WriteStream &stream)
Write the GFF3 to stream.
void addUint64(const Common::UString &label, uint64 value)
Add a new uint64.
void addVector(const Common::UString &label, glm::vec3 value)
Add a new Vector.
Handling BioWare's localized strings.
std::vector< GFF3WriterListPtr > _lists
Generic interface for a writable data stream.
A GFF3 struct containing GFF3 fields.
void addByte(const Common::UString &label, byte value)
Add a new byte.
std::vector< GFF3WriterStructPtr > _structs
void addUint32(const Common::UString &label, uint32 value)
Add a new uint32.
size_t getFieldCount() const
Get the count of fields.
std::vector< size_t > _fieldIndices
A GFF3 list containing GFF3 structs.
static uint32 getFieldDataSize(FieldPtr field)
Get the actual size of the field.
GFF3WriterStructPtr getTopLevel()
Get the top-level struct.
GFF3Writer::FieldPtr createField(GFF3Struct::FieldType type, const Common::UString &label)
GFF3Writer(uint32 id, uint32 version=MKTAG('V', '3', '.', '2'))
boost::shared_ptr< GFF3WriterList > GFF3WriterListPtr
std::vector< FieldPtr > _fields
void addUint16(const Common::UString &label, uint16 value)
Add a new uint16.
uint32 getID() const
Get ID of the struct.
void addSint64(const Common::UString &label, int64 value)
Add a new sint64.
void addDouble(const Common::UString &label, double value)
Add a new double.
void addSint32(const Common::UString &label, int32 value)
Add a new sint32.