32 #ifndef File_INCLUDE_ONCE 33 #define File_INCLUDE_ONCE 81 virtual bool isOpen()
const = 0;
84 virtual bool exists()
const = 0;
87 virtual void close() = 0;
90 virtual long long size()
const = 0;
105 long long peek(
void* buffer,
long long byte_count);
108 long long read(
void* buffer,
long long byte_count);
111 long long write(
const void* buffer,
long long byte_count);
114 long long position()
const;
117 bool seekSet(
long long offset);
120 bool seekCur(
long long offset);
123 bool seekEnd(
long long offset);
131 long long load(std::vector<char>& data);
136 long long load(
void* buffer,
long long max=-1);
139 double readDouble(
bool little_endian_data=
true);
141 float readFloat (
bool little_endian_data=
true);
143 unsigned long long readUInt64(
bool little_endian_data=
true);
145 long long readSInt64(
bool little_endian_data=
true);
147 unsigned int readUInt32(
bool little_endian_data=
true);
149 int readSInt32(
bool little_endian_data=
true);
151 unsigned short readUInt16(
bool little_endian_data=
true);
153 short readSInt16(
bool little_endian_data=
true);
155 unsigned char readUInt8();
160 long long readDouble(
double* buffer,
long long count,
bool little_endian_data=
true);
162 long long readFloat (
float* buffer,
long long count,
bool little_endian_data=
true);
164 long long readUInt64(
unsigned long long* buffer,
long long count,
bool little_endian_data=
true);
166 long long readSInt64(
long long* buffer,
long long count,
bool little_endian_data=
true);
168 long long readUInt32(
unsigned int* buffer,
long long count,
bool little_endian_data=
true);
170 long long readSInt32(
int* buffer,
long long count,
bool little_endian_data=
true);
172 long long readUInt16(
unsigned short* buffer,
long long count,
bool little_endian_data=
true);
174 long long readSInt16(
short* buffer,
long long count,
bool little_endian_data=
true);
176 long long readUInt8 (
unsigned char* buffer,
long long count);
178 long long readSInt8 (
char* buffer,
long long count);
181 long long writeDouble(
double data,
bool little_endian_data=
true);
183 long long writeFloat (
float data,
bool little_endian_data=
true);
185 long long writeUInt64(
unsigned long long data,
bool little_endian_data=
true);
187 long long writeSInt64(
long long data,
bool little_endian_data=
true);
189 long long writeUInt32(
unsigned int data,
bool little_endian_data=
true);
191 long long writeSInt32(
int data,
bool little_endian_data=
true);
193 long long writeUInt16(
unsigned short data,
bool little_endian_data=
true);
195 long long writeSInt16(
short data,
bool little_endian_data=
true);
197 long long writeUInt8 (
unsigned char data);
199 long long writeSInt8 (
char data);
202 long long writeDouble(
const double* buffer,
long long count,
bool little_endian_data=
true);
204 long long writeFloat (
const float* buffer,
long long count,
bool little_endian_data=
true);
206 long long writeUInt64(
const unsigned long long* buffer,
long long count,
bool little_endian_data=
true);
208 long long writeSInt64(
const long long* buffer,
long long count,
bool little_endian_data=
true);
210 long long writeUInt32(
const unsigned int* buffer,
long long count,
bool little_endian_data=
true);
212 long long writeSInt32(
const int* buffer,
long long count,
bool little_endian_data=
true);
214 long long writeUInt16(
const unsigned short* buffer,
long long count,
bool little_endian_data=
true);
216 long long writeSInt16(
const short* buffer,
long long count,
bool little_endian_data=
true);
218 long long writeUInt8 (
const unsigned char* buffer,
long long count);
220 long long writeSInt8 (
const char* buffer,
long long count);
223 virtual long long read_Implementation(
void* buffer,
long long byte_count) = 0;
224 virtual long long write_Implementation(
const void* buffer,
long long byte_count) = 0;
225 virtual long long position_Implementation()
const = 0;
226 virtual bool seekSet_Implementation(
long long offset) = 0;
229 long long write64(
const void* buffer,
long long count,
bool little_endian_data=
true);
230 long long write32(
const void* buffer,
long long count,
bool little_endian_data=
true);
231 long long write16(
const void* buffer,
long long count,
bool little_endian_data=
true);
233 long long read64(
void* buffer,
long long count,
bool little_endian_data=
true);
234 long long read32(
void* buffer,
long long count,
bool little_endian_data=
true);
235 long long read16(
void* buffer,
long long count,
bool little_endian_data=
true);
237 long long write64(
const void* buffer,
bool little_endian_data=
true);
238 long long write32(
const void* buffer,
bool little_endian_data=
true);
239 long long write16(
const void* buffer,
bool little_endian_data=
true);
241 long long read64(
void* buffer,
bool little_endian_data=
true);
242 long long read32(
void* buffer,
bool little_endian_data=
true);
243 long long read16(
void* buffer,
bool little_endian_data=
true);
VirtualFile & operator=(const VirtualFile &other)
An abstract class representing a file.
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
bool endOfFile() const
Returns true if position() >= size()
String & normalizeSlashes()
Transform \ slashes in / slashes and removes duplicates.
const String & path() const
Returns the path of the file.
Visualization Library main namespace.
VirtualFile(const VirtualFile &other)
VirtualFile()
Constructor.
The base class for all the reference counted objects.
float max(float a, float b)
Computes the MD5 of a given buffer or VirtualFile.
#define VL_INSTRUMENT_ABSTRACT_CLASS(ClassName, BaseClass)
VLCORE_EXPORT ref< VirtualFile > locateFile(const String &path)
Utility function, equivalent to vl::defFileSystem()->locateFile(path)
void setPath(const String &name)
Changes the path bound to a VirtualFile. Use carefully this function, you shouldn't rename a VirtualF...
The ref<> class is used to reference-count an Object.
Visualization Library's enums in the 'vl' namespace.