Mapper  0.9.0
API documentation
Public Member Functions | Static Public Member Functions | List of all members
OpenOrienteering::OcdFileFormat Class Reference

The map file format known as OC*D. More...

#include <ocd_file_format.h>

Inheritance diagram for OpenOrienteering::OcdFileFormat:
Inheritance graph
[legend]
Collaboration diagram for OpenOrienteering::OcdFileFormat:
Collaboration graph
[legend]

Public Member Functions

 OcdFileFormat (quint16 version)
 Constructs a new OcdFileFormat. More...
 
ImportSupportAssumption understands (const char *buffer, int size) const override
 Detects whether the buffer may be the start of a valid OCD file. More...
 
std::unique_ptr< ImportermakeImporter (const QString &path, Map *map, MapView *view) const override
 
std::unique_ptr< ExportermakeExporter (const QString &path, const Map *map, const MapView *view) const override
 
- Public Member Functions inherited from OpenOrienteering::FileFormat
 FileFormat (FileType file_type, const char *id, const QString &description, const QString &file_extension, Features features)
 Creates a new file format with the given parameters. More...
 
 FileFormat (const FileFormat &)=delete
 
 FileFormat (FileFormat &&)=delete
 
virtual ~FileFormat ()
 Destroys the file format information. More...
 
FileFormatoperator= (const FileFormat &)=delete
 
FileFormatoperator= (FileFormat &&)=delete
 
void addExtension (const QString &file_extension)
 Registers an alternative file name extension. More...
 
FileType fileType () const
 Returns the type of file. More...
 
const char * id () const
 Returns the internal ID of the file format. More...
 
const QStringdescription () const
 Returns a short human-readable description of the file format. More...
 
const QStringprimaryExtension () const
 Returns the primary file name extension used by this file format. More...
 
const QStringListfileExtensions () const
 Returns all file name extension supported by this file format. More...
 
const QStringfilter () const
 Returns the filter that represents this format in file dialogs. More...
 
bool supportsReading () const
 Returns true if this format supports reading a Map from a file. More...
 
bool supportsWriting () const
 Returns true if this format supports writing a Map to a file. More...
 
bool supportsFileOpen () const
 Returns true if this format is available for File > Open... More...
 
bool supportsFileSave () const
 Returns true if this format is available for File > Save. More...
 
bool supportsFileSaveAs () const
 Returns true if this format is available for File > Save as... More...
 
bool supportsFileImport () const
 Returns true if this format is available for File > Import... More...
 
bool supportsFileExport () const
 Returns true if this format is available for File > Export... More...
 
bool isReadingLossy () const
 Returns true if an importer for this file format is potentially lossy. More...
 
bool isWritingLossy () const
 Returns true if an exporter for this file format is potentially lossy. More...
 

Static Public Member Functions

static const char * idForVersion (quint16 version)
 Returns the file format ID string for the given version. More...
 
static std::vector< std::unique_ptr< OcdFileFormat > > makeAll ()
 Returns a container of all supported variants of this format. More...
 
static constexpr const char * versionProperty ()
 The name of the property where the importer can record the imported version. More...
 
static constexpr quint16 autoDeterminedVersion ()
 A special value which indicates the usage of an auto-detected (or default) version. More...
 
static constexpr quint16 legacyVersion ()
 A special value which indicates the usage of the legacy import/export. More...
 

Additional Inherited Members

- Public Types inherited from OpenOrienteering::FileFormat
enum  FileType { MapFile = 0x01, OgrFile = 0x02, AllFiles = MapFile, EndOfFileTypes }
 File type enumeration. More...
 
enum  Feature {
  Feature::FileOpen = 0x01, Feature::FileSave = 0x02, Feature::FileSaveAs = 0x04, Feature::FileImport = 0x08,
  Feature::FileExport = 0x10, Feature::ReadingLossy = 0x100, Feature::WritingLossy = 0x200
}
 A type which handles OR-combinations of file types. More...
 
enum  ImportSupportAssumption { NotSupported = 0, Unknown = 1, FullySupported = 2 }
 A type which handles OR-combinations of format implementation features. More...
 

Detailed Description

The map file format known as OC*D.

Constructor & Destructor Documentation

◆ OcdFileFormat()

OpenOrienteering::OcdFileFormat::OcdFileFormat ( quint16  version)

Constructs a new OcdFileFormat.

Supported explicit OCD versions for export are 8 to 12. In addition to these versions, the following special values are valid:

Supplying an unsupported version will cause the program to abort.

Member Function Documentation

◆ autoDeterminedVersion()

static constexpr quint16 OpenOrienteering::OcdFileFormat::autoDeterminedVersion ( )
inlinestatic

A special value which indicates the usage of an auto-detected (or default) version.

◆ idForVersion()

const char * OpenOrienteering::OcdFileFormat::idForVersion ( quint16  version)
static

Returns the file format ID string for the given version.

◆ legacyVersion()

static constexpr quint16 OpenOrienteering::OcdFileFormat::legacyVersion ( )
inlinestatic

A special value which indicates the usage of the legacy import/export.

◆ makeAll()

std::vector< std::unique_ptr< OcdFileFormat > > OpenOrienteering::OcdFileFormat::makeAll ( )
static

Returns a container of all supported variants of this format.

◆ makeExporter()

std::unique_ptr< Exporter > OpenOrienteering::OcdFileFormat::makeExporter ( const QString path,
const Map map,
const MapView view 
) const
overridevirtual

Reimplemented from OpenOrienteering::FileFormat.

◆ makeImporter()

std::unique_ptr< Importer > OpenOrienteering::OcdFileFormat::makeImporter ( const QString path,
Map map,
MapView view 
) const
overridevirtual

Reimplemented from OpenOrienteering::FileFormat.

◆ understands()

FileFormat::ImportSupportAssumption OpenOrienteering::OcdFileFormat::understands ( const char *  buffer,
int  size 
) const
overridevirtual

Detects whether the buffer may be the start of a valid OCD file.

At the moment, it requires at least two bytes of data. It will return false if compiled for a big endian system.

Reimplemented from OpenOrienteering::FileFormat.

◆ versionProperty()

static constexpr const char* OpenOrienteering::OcdFileFormat::versionProperty ( )
inlinestatic

The name of the property where the importer can record the imported version.


The documentation for this class was generated from the following files: