Regina Calculation Engine
|
Stores information about a Regina data file, including file type and version. More...
#include <file/nfileinfo.h>
Public Member Functions | |
const std::string & | getPathname () const |
Returns the pathname of the data file being described. | |
int | getType () const |
Returns the type of data file. | |
const std::string & | getTypeDescription () const |
Returns a human-readable description of the type of data file. | |
const std::string & | getEngine () const |
Returns the version of the calculation engine that wrote this file. | |
bool | isCompressed () const |
Returns whether this file is stored in compressed format. | |
bool | isInvalid () const |
Returns whether the file metadata could not be read. | |
void | writeTextShort (std::ostream &out) const |
Writes this object in short text format to the given output stream. | |
void | writeTextLong (std::ostream &out) const |
Writes this object in long text format to the given output stream. | |
Static Public Member Functions | |
static NFileInfo * | identify (const std::string &idPathname) |
Return information about the given Regina data file. | |
Static Public Attributes | |
static const int | TYPE_BINARY |
Represents an old-style binary data file. | |
static const int | TYPE_XML |
Represents a new-style XML data file. |
Stores information about a Regina data file, including file type and version.
Routine identify() can be used to determine this information for a given file.
const std::string & regina::NFileInfo::getEngine | ( | ) | const [inline] |
Returns the version of the calculation engine that wrote this file.
const std::string & regina::NFileInfo::getPathname | ( | ) | const [inline] |
Returns the pathname of the data file being described.
int regina::NFileInfo::getType | ( | ) | const [inline] |
Returns the type of data file.
The type will be given as one of the file type constants defined in this class.
const std::string & regina::NFileInfo::getTypeDescription | ( | ) | const [inline] |
Returns a human-readable description of the type of data file.
static NFileInfo* regina::NFileInfo::identify | ( | const std::string & | idPathname | ) | [static] |
Return information about the given Regina data file.
idPathname | the pathname of the data file to be examined. |
bool regina::NFileInfo::isCompressed | ( | ) | const [inline] |
Returns whether this file is stored in compressed format.
Currently this option only applies to XML data files.
true
if this file is compressed or false
otherwise. bool regina::NFileInfo::isInvalid | ( | ) | const [inline] |
Returns whether the file metadata could not be read.
true
if the metadata could not be read, false
otherwise. void regina::NFileInfo::writeTextLong | ( | std::ostream & | out | ) | const [virtual] |
Writes this object in long text format to the given output stream.
The output should provided the user with all the information they could want. The output should end with a newline.
The default implementation of this routine merely calls writeTextShort() and adds a newline.
out | the output stream to which to write. |
Reimplemented from regina::ShareableObject.
void regina::NFileInfo::writeTextShort | ( | std::ostream & | out | ) | const [virtual] |
Writes this object in short text format to the given output stream.
The output should fit on a single line and no newline should be written.
out | the output stream to which to write. |
Implements regina::ShareableObject.
const int regina::NFileInfo::TYPE_BINARY [static] |
Represents an old-style binary data file.
const int regina::NFileInfo::TYPE_XML [static] |
Represents a new-style XML data file.