50 if (serializer.
error())
73 if (serializer.
error())
97 serializer.
saveVLT( file, res_db );
99 if (serializer.
error())
118 serializer.
saveVLB( file, res_db );
120 if (serializer.
error())
136 char vlx[12] = { 0 };
137 memset(vlx, 0,
sizeof(vlx));
140 file->
read(vlx,
sizeof(vlx));
142 return memcmp(vlx,
"VLX version=",
sizeof(vlx)) == 0;
155 unsigned char vlx_identifier[] = { 0xAB,
'V',
'L',
'X', 0xBB, 0x0D, 0x0A, 0x1A, 0x0A };
156 unsigned char vlx[
sizeof(vlx_identifier)];
157 memset(vlx, 0,
sizeof(vlx));
160 file->
read(vlx,
sizeof(vlx));
162 return memcmp(vlx, vlx_identifier,
sizeof(vlx_identifier)) == 0;
long long read(void *buffer, long long byte_count)
Reads byte_count bytes from a file. Returns the number of bytes actually read.
VLX_EXPORT bool saveVLT(vl::VirtualFile *file, const vl::ResourceDatabase *)
An abstract class representing a file.
vl::ref< vl::Object > loadVLB(const vl::String &path, bool start_fresh=true)
A simple String formatting class.
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
const char * errorString() const
vl::ref< vl::Object > loadVLT(const vl::String &path, bool start_fresh=true)
virtual void close()=0
Closes the file.
Visualization Library main namespace.
VLX_EXPORT bool isVLT(vl::VirtualFile *file)
EError error() const
The last signaled error.
virtual bool open(EOpenMode mode)=0
Opens the file in the specified mode.
T * as()
Casts an Object to the specified class.
VLX_EXPORT bool isVLB(vl::VirtualFile *file)
VLX_EXPORT vl::ref< vl::ResourceDatabase > loadVLT(vl::VirtualFile *file)
bool saveVLT(const vl::String &path, const vl::Object *obj, bool start_fresh=true)
VLCORE_EXPORT ref< VirtualFile > locateFile(const String &path)
Utility function, equivalent to vl::defFileSystem()->locateFile(path)
Translates an arbitrary set of vl::Object (and subclasses) into VLB and VLT format.
bool saveVLB(const vl::String &path, const vl::Object *obj, bool start_fresh=true)
A VirtualFile that operates on regular disk files.
VLX_EXPORT bool saveVLB(vl::VirtualFile *file, const vl::ResourceDatabase *)
The ref<> class is used to reference-count an Object.
VLX_EXPORT vl::ref< vl::ResourceDatabase > loadVLB(vl::VirtualFile *file)
The ResourceDatabase class contains and manipulates a set of resources.