Inherits ISupportFile.
Inheritance diagram for MXASupportFile:
Public Member Functions | |
MXA_SHARED_POINTERS (MXASupportFile) | |
MXA_TYPE_MACRO (MXASupportFile) | |
virtual | ~MXASupportFile () |
virtual void | setFileSystemPath (const std::string &filesystemPath) |
Sets the path to the file on the local filesystem. | |
virtual std::string | getFileSystemPath () |
Returns the path to the file on the local filesystem. | |
virtual void | setFileType (const std::string &fileType) |
Sets the File type as a hint for viewers on how to render the file if possible. The default is "Binary". You may also use "Text". | |
virtual std::string | getFileType () |
Returns the file type. | |
virtual uint8 * | getFilePointer (uint64 offset=0) |
Returns a pointer to the specified offset in the cached file. Note that if the file has NOT been read then this will return a NULL pointer. | |
virtual uint64 | getFileSize () |
Returns the size of the file which could be Zero if the file has NOT been read or can not be read. | |
virtual bool | isFileCached () |
Has the file been read into memory. | |
virtual int32 | readFromFileSystem () |
Read from the filesystem and cache the file into memory. Careful when doing this with large files. | |
virtual void | flushCachedFile () |
If the file is residing in memory, free the memory by unloading the file from memory. | |
virtual void | setIndex (int index) |
Sets the internal value used by the MXA API to store the file in teh HDF5 file. | |
virtual int | getIndex () |
Returns the internal index used by the MXA API to store the file in the HDF5 file. | |
virtual int32 | readFromMXAFile () |
Reads file contents from the HDF5 file into memory. From this point you can write the file out to the local filesystem if needed. | |
Static Public Member Functions | |
static ISupportFile::Pointer | NewFromFileSystem (const std::string &filesystempath, const std::string &filetype, bool cacheFile=false) |
Creates a new MXASupportFile object based on the path to a file on the local filesystem. | |
static ISupportFile::Pointer | New () |
Creates a new MXASupportFile object based on the meta data from the HDF5 file Creates a new MXASupportFile object with default values. | |
Protected Member Functions | |
MXASupportFile () | |
MXASupportFile (int32 datafile, int index) | |
Private Member Functions | |
MXASupportFile (const MXASupportFile &) | |
void | operator= (const MXASupportFile &) |
Private Attributes | |
std::string | _filesystemPath |
std::string | _fileType |
IMXAArray::Pointer | _fileContents |
int | _index |
int32 | _fileId |
int | _source |
MXASupportFile::~MXASupportFile | ( | ) | [virtual] |
MXASupportFile::MXASupportFile | ( | ) | [protected] |
MXASupportFile::MXASupportFile | ( | int32 | datafile, | |
int | index | |||
) | [protected] |
MXASupportFile::MXASupportFile | ( | const MXASupportFile & | ) | [private] |
MXASupportFile::MXA_SHARED_POINTERS | ( | MXASupportFile | ) |
MXASupportFile::MXA_TYPE_MACRO | ( | MXASupportFile | ) |
ISupportFile::Pointer MXASupportFile::NewFromFileSystem | ( | const std::string & | filesystempath, | |
const std::string & | filetype, | |||
bool | cacheFile = false | |||
) | [static] |
Creates a new MXASupportFile object based on the path to a file on the local filesystem.
filesystempath | The path to the file on the local filesystem | |
filetype | Either "Text" or "Binary" | |
cacheFile | False by default which means the actual reading of the file is put off until it is explicitly asked for. If you set this argument to "true" then the file is read immediately. |
ISupportFile::Pointer MXASupportFile::New | ( | ) | [static] |
Creates a new MXASupportFile object based on the meta data from the HDF5 file Creates a new MXASupportFile object with default values.
void MXASupportFile::setFileSystemPath | ( | const std::string & | filesystemPath | ) | [virtual] |
Sets the path to the file on the local filesystem.
filesystemPath | The path to the file on the local filesystem |
Implements ISupportFile.
std::string MXASupportFile::getFileSystemPath | ( | ) | [virtual] |
void MXASupportFile::setFileType | ( | const std::string & | fileType | ) | [virtual] |
Sets the File type as a hint for viewers on how to render the file if possible. The default is "Binary". You may also use "Text".
fileType | "Binary" or "Text" |
Implements ISupportFile.
std::string MXASupportFile::getFileType | ( | ) | [virtual] |
uint8 * MXASupportFile::getFilePointer | ( | uint64 | offset = 0 |
) | [virtual] |
Returns a pointer to the specified offset in the cached file. Note that if the file has NOT been read then this will return a NULL pointer.
offset | The offset into the cached file to read. |
Implements ISupportFile.
uint64 MXASupportFile::getFileSize | ( | ) | [virtual] |
Returns the size of the file which could be Zero if the file has NOT been read or can not be read.
Implements ISupportFile.
bool MXASupportFile::isFileCached | ( | ) | [virtual] |
int32 MXASupportFile::readFromFileSystem | ( | ) | [virtual] |
Read from the filesystem and cache the file into memory. Careful when doing this with large files.
Implements ISupportFile.
void MXASupportFile::flushCachedFile | ( | ) | [virtual] |
If the file is residing in memory, free the memory by unloading the file from memory.
Implements ISupportFile.
void MXASupportFile::setIndex | ( | int | index | ) | [virtual] |
Sets the internal value used by the MXA API to store the file in teh HDF5 file.
index | The index to use. |
Implements ISupportFile.
int MXASupportFile::getIndex | ( | ) | [virtual] |
Returns the internal index used by the MXA API to store the file in the HDF5 file.
Implements ISupportFile.
int32 MXASupportFile::readFromMXAFile | ( | ) | [virtual] |
Reads file contents from the HDF5 file into memory. From this point you can write the file out to the local filesystem if needed.
Implements ISupportFile.
void MXASupportFile::operator= | ( | const MXASupportFile & | ) | [private] |
std::string MXASupportFile::_filesystemPath [private] |
std::string MXASupportFile::_fileType [private] |
IMXAArray::Pointer MXASupportFile::_fileContents [private] |
int MXASupportFile::_index [private] |
int32 MXASupportFile::_fileId [private] |
int MXASupportFile::_source [private] |