59 Log::error(
"QtFile::open(): file already open.\n");
63 QIODevice::OpenMode qmode;
67 qmode = QIODevice::ReadOnly;
71 qmode = QIODevice::WriteOnly;
74 mQFile.setFileName(
path().toStdString().c_str());
96 return QFile(
path().toStdString().c_str()).size();
101 return !
path().
empty() && QFile::exists(
path().toStdString().c_str());
108 Log::error(
"QtFile::read_Implementation() called on closed file!\n");
111 return mQFile.read((
char *)buffer, byte_count);
118 Log::error(
"QtFile::write_Implementation() called on closed file!\n");
121 return mQFile.write((
char *)buffer, byte_count);
128 Log::error(
"QtFile::position_Implementation() called on closed file!\n");
138 Log::error(
"QtFile::seekSet_Implementation() called on closed file!\n");
148 file->operator=(*this);
virtual long long position_Implementation() const
A simple String formatting class.
bool open(const String &path, EOpenMode mode)
The specified path is relative to the parent directory. See setPhysicalPath().
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
virtual long long read_Implementation(void *buffer, long long byte_count)
virtual bool seekSet_Implementation(long long offset)
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
virtual bool exists() const
Returns true if the file exists.
virtual ref< VirtualFile > clone() const
Creates a clone of this class instance.
const String & path() const
Returns the path of the file.
Visualization Library main namespace.
bool empty() const
Returns true if length() == 0.
QtFile(const QtFile &other)
virtual long long write_Implementation(const void *buffer, long long byte_count)
void setPath(const String &name)
Changes the path bound to a VirtualFile. Use carefully this function, you shouldn't rename a VirtualF...
virtual long long size() const
Returns the file size in bytes or -1 on error.
The ref<> class is used to reference-count an Object.
virtual void close()
Closes the file.
virtual bool isOpen() const
Returns true if the file has been opened.