67 void *
operator new(
size_t size);
75 void operator delete(
void *mem);
139 bool FindSymbol(
const char *tag,
const char **value,
bool fail);
150 bool FindInt(
const char *tag,
int *value,
bool fail);
161 bool FindFloat(
const char *tag,
float *value,
bool fail);
172 bool FindBool(
const char *tag,
bool *value,
bool fail);
278 void SetType(
int i,
int type);
282 return &mNodes[mSize].i;
DataArray * NewDataArray(int size)
Create an array of integer zeroes, with one reference.
void DataMergeTags(DataArray *dest, DataArray *src)
Merge the nested arrays of one array into another by their first node.
Stream of raw bytes, the base of the memory, file, and network streams.
Definition binstream.h:22
Reference-counted array of script data nodes.
Definition dataarray.h:20
int Type(int i)
Report the type of a node.
bool FindBool(const char *tag, bool *value, bool fail)
Read the integer after a tag as a truth value.
int Size() const
Definition Data.h:249
void Print(PrnStream &s)
Write the array in script syntax.
DataNode Node(int i)
Read a node of any type.
DataArray * FindArray(int tag)
Find the nested array whose first node equals a value.
bool FindSymbol(const char *tag, const char **value, bool fail)
Read the symbol after a tag.
void Resize(int size)
Change the number of nodes.
void Release()
Drop a reference, deleting the array with its last one.
DataArray * Array(int i)
Read an array node.
void AddRef()
Take a reference.
int Int(int i)
Read an integer node.
bool FindInt(const char *tag, int *value, bool fail)
Read the integer after a tag.
DataType
The type of a node.
Definition Data.h:21
@ kDataFloat
Definition Data.h:24
@ kDataInt
Definition Data.h:22
@ kDataSymbol
Definition Data.h:23
@ kDataArray
Definition Data.h:25
DataArray(BinStream &bs, std::vector< const char * > &filenames)
Read an array, with one reference, as a compiled script stores it.
void SetFileLine(const char *file, int line)
Record where the array was defined.
void SetNode(int i, DataNode value, int type)
Replace a node.
const char * Sym(int i)
Read a symbol node.
DataArray(int size)
Create an array of integer zeroes, with one reference.
bool FindFloat(const char *tag, float *value, bool fail)
Read the real number after a tag.
DataArray * FindArray(const char *tag, bool fail)
Find the nested array whose first node is a symbol.
float Float(int i)
Read a real number node.
~DataArray()
Release the child arrays and free the nodes.
DataArray(int nSize)
Construct an array of cleared integer nodes with one reference.
Text output stream.
Definition prnstream.h:16
One node.
Definition Data.h:29
float f
Definition Data.h:31
const char * sym
Definition Data.h:32
DataArray * array
Definition Data.h:33
int i
Definition Data.h:30