soma-io  5.1.2
soma::FormatDictionary< T > Class Template Reference

Formats holder for each format of Cartograph object, used by Reader and Writer. More...

#include <soma-io/io/formatdictionary.h>

Static Public Member Functions

static void registerFormat (const std::string &formatID, FormatReader< T > *format, const std::vector< std::string > &extensions)
 
static void registerFormat (const std::string &formatID, FormatWriter< T > *format, const std::vector< std::string > &extensions)
 
static FormatReader< T > * readFormat (const std::string &format)
 
static FormatWriter< T > * writeFormat (const std::string &format)
 
static const std::multimap< std::string, std::string > & readExtensions ()
 
static const std::multimap< std::string, std::string > & writeExtensions ()
 
static std::set< std::string > readFormats ()
 
static std::set< std::string > writeFormats ()
 
static void registerBaseFormats ()
 builds base formats maps. More...
 
static void init ()
 

Detailed Description

template<typename T>
class soma::FormatDictionary< T >

Formats holder for each format of Cartograph object, used by Reader and Writer.

FormatDictionary is a plug-in mechanism to allow new formats to be registered.
It uses at lower level specific IO classes for each format (GisFormat for GIS, SpmReader for SPM, etc., and IO classes for other object types (meshes, buckets, textures, ...))

Adding new IO formats

The standard carto/aims libraries include a set of already compiled Readers and writers.

If you need to use other types, you'll have to include soma-io/io/reader_d.h and / or soma-io/io/writer_d.h in order to have the template functions definitions, soma-io/io/reader.h and soma-io/io/writer.h are only the class declarations. In addition, you may want to specialize the registerBaseFormats() functions of specific FormatDictionary specializations.

See also
Reader Writer DataSourceInfo Process

Definition at line 75 of file formatdictionary.h.

Member Function Documentation

◆ init()

◆ readExtensions()

template<typename T >
const std::multimap< std::string, std::string > & soma::FormatDictionary< T >::readExtensions
static

Definition at line 91 of file formatdictionary_d.h.

Referenced by soma::Reader< T >::read().

◆ readFormat()

template<typename T >
FormatReader< T > * soma::FormatDictionary< T >::readFormat ( const std::string &  format)
static

Definition at line 173 of file formatdictionary_d.h.

Referenced by soma::Reader< T >::read().

◆ readFormats()

template<typename T >
std::set< std::string > soma::FormatDictionary< T >::readFormats
static

Definition at line 200 of file formatdictionary_d.h.

Referenced by soma::Reader< T >::read().

◆ registerBaseFormats()

template<typename T >
void soma::FormatDictionary< T >::registerBaseFormats
static

builds base formats maps.

The formats list is dynamically extensible, you can register your own whenever you want

Definition at line 126 of file formatdictionary_d.h.

◆ registerFormat() [1/2]

template<typename T >
void soma::FormatDictionary< T >::registerFormat ( const std::string &  formatID,
FormatReader< T > *  format,
const std::vector< std::string > &  extensions 
)
static

Definition at line 133 of file formatdictionary_d.h.

◆ registerFormat() [2/2]

template<typename T >
void soma::FormatDictionary< T >::registerFormat ( const std::string &  formatID,
FormatWriter< T > *  format,
const std::vector< std::string > &  extensions 
)
static

Definition at line 153 of file formatdictionary_d.h.

◆ writeExtensions()

template<typename T >
const std::multimap< std::string, std::string > & soma::FormatDictionary< T >::writeExtensions
static

Definition at line 99 of file formatdictionary_d.h.

Referenced by soma::Writer< T >::write().

◆ writeFormat()

template<typename T >
FormatWriter< T > * soma::FormatDictionary< T >::writeFormat ( const std::string &  format)
static

Definition at line 187 of file formatdictionary_d.h.

Referenced by soma::Writer< T >::write().

◆ writeFormats()

template<typename T >
std::set< std::string > soma::FormatDictionary< T >::writeFormats
static

Definition at line 213 of file formatdictionary_d.h.


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