Regina 7.0 Calculation Engine
Classes | Enumerations | Functions
File I/O

File formats and the filesystem. More...

Classes

class  regina::FileInfo
 Stores information about a Regina data file, including file format and version. More...
 
class  regina::GlobalDirs
 Provides global routines that return directories in which various components of Regina are installed on the system. More...
 

Enumerations

enum  regina::FileFormat { regina::REGINA_BINARY_GEN_1 = 1 , regina::REGINA_XML_GEN_2 = 2 , regina::REGINA_XML_GEN_3 = 3 , regina::REGINA_CURRENT_FILE_FORMAT = REGINA_XML_GEN_3 }
 Represents each generation of Regina's file formats. More...
 

Functions

void regina::swap (FileInfo &a, FileInfo &b) noexcept
 Swaps the contents of the two given file information objects. More...
 

Detailed Description

File formats and the filesystem.

Enumeration Type Documentation

◆ FileFormat

Represents each generation of Regina's file formats.

These constants are intended to capture "generational changes" to the file format, where backward compatibility is broken (i.e., where older versions of Regina that do not know about the new generation format cannot even attempt to read its data files at all).

In constrast, they do not capture incremental changes (e.g., new elements in data files that correspond to new features of Regina, which are simply ignored when an older version of Regina sees them).

Put differently: within each generation, the file formats should be considered "interoperable", in that they maintain both forward and backward compatibility as far as possible. In contrast, between generations the file formats are not compatible at all, and require some form of explicit conversion.

Of course, Regina can still read and write some older generation formats; these abilities are indicated alongside the constants below.

Enumerator
REGINA_BINARY_GEN_1 

Indicates the old first-generation binary format used by Regina 2.4 and earlier.

This format was discontinued in mid-2002, when Regina adopted an XML-based format instead.

Regina no longer supports this (ancient) binary format at all: since version 4.94 in late 2013, Regina cannot read or write this format.

REGINA_XML_GEN_2 

Indicates the second-generation file format used from Regina 3.0 through to Regina 6.0.1 inclusive.

This was the first file format based on XML. The root XML element is reginadata.

Regina can still transparently read second-generation data files, and can write them when explicitly asked.

REGINA_XML_GEN_3 

Indicates the third-generation file format used from Regina 7.0 onwards.

This format is both more streamlined and more human-readable. The root XML element is regina.

This is the current file format, and is used by default when saving data files.

REGINA_CURRENT_FILE_FORMAT 

An alias for whichever file format is current.

The numerical value of this constant may change in future releases of Regina, if/when new generational changes to the file format occur.

Function Documentation

◆ swap()

void regina::swap ( FileInfo a,
FileInfo b 
)
inlinenoexcept

Swaps the contents of the two given file information objects.

This global routine simply calls FileInfo::swap(); it is provided so that FileInfo meets the C++ Swappable requirements.

Parameters
athe object whose contents should be swapped with b.
bthe object whose contents should be swapped with a.

Copyright © 1999-2021, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@maths.uq.edu.au).