Stores information about a Regina data file, including file format and version.
More...
|
| FileInfo (const FileInfo &)=default |
| Creates a new copy of the given file information. More...
|
|
| FileInfo (FileInfo &&) noexcept=default |
| Moves the contents of the given file information to this new object. More...
|
|
const std::string & | pathname () const |
| Returns the pathname of the data file being described. More...
|
|
FileFormat | format () const |
| Returns which of Regina's file formats the data file uses. More...
|
|
std::string | formatDescription () const |
| Returns a human-readable description of the file format used by the data file. More...
|
|
const std::string & | engine () const |
| Returns the version of the calculation engine that wrote this file. More...
|
|
bool | isCompressed () const |
| Returns whether this file is stored in compressed format. More...
|
|
bool | isInvalid () const |
| Returns whether the file metadata could not be read. More...
|
|
FileInfo & | operator= (const FileInfo &)=default |
| Sets this to be a copy of the given file information. More...
|
|
FileInfo & | operator= (FileInfo &&) noexcept=default |
| Moves the contents of the given file information to this new object. More...
|
|
void | swap (FileInfo &other) noexcept |
| Swaps the contents of this and the given file information. More...
|
|
bool | operator== (const FileInfo &other) const |
| Determines whether this and the given file information describe the same format and version. More...
|
|
bool | operator!= (const FileInfo &other) const |
| Determines whether this and the given file information do not describe the same format and version. More...
|
|
void | writeTextShort (std::ostream &out) const |
| Writes a short text representation of this object to the given output stream. More...
|
|
void | writeTextLong (std::ostream &out) const |
| Writes a detailed text representation of this object to the given output stream. More...
|
|
std::string | str () const |
| Returns a short text representation of this object. More...
|
|
std::string | utf8 () const |
| Returns a short text representation of this object using unicode characters. More...
|
|
std::string | detail () const |
| Returns a detailed text representation of this object. More...
|
|
Stores information about a Regina data file, including file format and version.
Routine identify() can be used to determine this information for a given file.
As of Regina 4.94, the ancient first-generation binary files (REGINA_BINARY_GEN_1) are no longer supported, and this class cannot recognise them at all. These have not been in use since mid-2002. The only file formats that this class now recognises are Regina's newer XML-based (compressed or uncompressed) data files.
This class implements C++ move semantics and adheres to the C++ Swappable requirement, though it does not implement (or need) its own custom swap() function. It is designed to avoid deep copies wherever possible, even when passing or returning objects by value.
bool regina::FileInfo::operator!= |
( |
const FileInfo & |
other | ) |
const |
|
inline |
Determines whether this and the given file information do not describe the same format and version.
For two FileInfo objects to compare as equal, they must have the same file formats, use the same version of the calculation engine, and use the same compression type. The pathnames of the files being described are ignored.
It is safe to compare FileInfo objects even if one or both is invalid. Two invalid FileInfo objects will compare as equal.
- Parameters
-
other | the file information to compare with this. |
- Returns
true
if and only if this and the given file information do not describe the same format and version, as described above.
bool regina::FileInfo::operator== |
( |
const FileInfo & |
other | ) |
const |
|
inline |
Determines whether this and the given file information describe the same format and version.
For two FileInfo objects to compare as equal, they must have the same file formats, use the same version of the calculation engine, and use the same compression type. The pathnames of the files being described are ignored.
It is safe to compare FileInfo objects even if one or both is invalid. Two invalid FileInfo objects will compare as equal.
- Parameters
-
other | the file information to compare with this. |
- Returns
true
if and only if this and the given file information describe the same format and version, as described above.
Returns a short text representation of this object.
This text should be human-readable, should use plain ASCII characters where possible, and should not contain any newlines.
Within these limits, this short text ouptut should be as information-rich as possible, since in most cases this forms the basis for the Python str()
and repr()
functions.
- Python
- The Python "stringification" function
str()
will use precisely this function, and for most classes the Python repr()
function will incorporate this into its output.
- Returns
- a short text representation of this object.
Returns a short text representation of this object using unicode characters.
Like str(), this text should be human-readable, should not contain any newlines, and (within these constraints) should be as information-rich as is reasonable.
Unlike str(), this function may use unicode characters to make the output more pleasant to read. The string that is returned will be encoded in UTF-8.
- Returns
- a short text representation of this object.