ISIS Core Library 0.7.2 (api 3.0.0)
Public Types | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends

isis::data::IOFactory Class Reference

#include <io_factory.hpp>

Public Types

typedef std::list< FileFormatPtrFileFormatList
typedef boost::shared_ptr
< image_io::FileFormat
FileFormatPtr

Static Public Member Functions

static std::list< data::ImagechunkListToImageList (std::list< Chunk > &chunks)
 Make images out of a (unordered) list of chunks.
static FileFormatList getFileFormatList (std::string filename, util::istring suffix_override="", util::istring dialect="")
 Get all formats which should be able to read/write the given file.
static FileFormatList getFormats ()
 Get a list of all known file-formats (aka. io-plugins loaded)
static std::list< data::Imageload (const std::string &path, util::istring suffix_override="", util::istring dialect="")
 Load a data file or directory with given filename and dialect.
static size_t load (std::list< data::Chunk > &chunks, const std::string &path, util::istring suffix_override="", util::istring dialect="")
 Load a data file with given filename and dialect into a chunklist.
static std::list< data::Imageload (const util::slist &paths, util::istring suffix_override="", util::istring dialect="")
 Load data from a set of files or directories with given paths and dialect.
static void setProgressFeedback (boost::shared_ptr< util::ProgressFeedback > feedback)
static bool write (std::list< data::Image > images, const std::string &path, util::istring suffix_override="", util::istring dialect="")
static bool write (const data::Image &image, const std::string &path, util::istring suffix_override="", util::istring dialect="")

Protected Member Functions

unsigned int findPlugins (const std::string &path)
 IOFactory ()
size_t loadFile (std::list< Chunk > &ret, const boost::filesystem::path &filename, util::istring suffix_override="", util::istring dialect="")
size_t loadPath (std::list< Chunk > &ret, const boost::filesystem::path &path, util::istring suffix_override="", util::istring dialect="")
bool registerFileFormat (const FileFormatPtr plugin)

Static Protected Member Functions

static IOFactoryget ()

Protected Attributes

FileFormatList io_formats

Friends

class util::Singletons

Detailed Description

Definition at line 37 of file io_factory.hpp.


Member Typedef Documentation

Definition at line 41 of file io_factory.hpp.

Definition at line 40 of file io_factory.hpp.


Constructor & Destructor Documentation

API_EXCLUDE_BEGIN _internal API_EXCLUDE_BEGIN isis::data::IOFactory::IOFactory ( ) [protected]

Definition at line 81 of file io_factory.cpp.


Member Function Documentation

std::list< Image > isis::data::IOFactory::chunkListToImageList ( std::list< Chunk > &  chunks) [static]

Make images out of a (unordered) list of chunks.

Uses the chunks in the chunklist to fit them together into images. This removes _every_ image from chunks - so make a copy if you need them

Parameters:
chunkslist of chunks to be used for the new images.
Returns:
a list of newly created images consisting off chunks out of the given chunk list.

Definition at line 297 of file io_factory.cpp.

unsigned int isis::data::IOFactory::findPlugins ( const std::string &  path) [protected]

Definition at line 141 of file io_factory.cpp.

IOFactory & isis::data::IOFactory::get ( ) [static, protected]

Definition at line 212 of file io_factory.cpp.

IOFactory::FileFormatList isis::data::IOFactory::getFileFormatList ( std::string  filename,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Get all formats which should be able to read/write the given file.

Parameters:
filenamethe file which should be red/written
suffix_overrideif given, it will override the suffix of the given file (and thus enforce usage of a format)
dialectif given, the plugins supporting the dialect are preferred

Definition at line 260 of file io_factory.cpp.

IOFactory::FileFormatList isis::data::IOFactory::getFormats ( ) [static]

Get a list of all known file-formats (aka. io-plugins loaded)

Definition at line 438 of file io_factory.cpp.

std::list< data::Image > isis::data::IOFactory::load ( const std::string &  path,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Load a data file or directory with given filename and dialect.

Parameters:
pathfile or directory to load
suffix_overrideoverride the given suffix with this one (especially if there's no suffix)
dialectdialect of the fileformat to load
Returns:
list of images created from the loaded data

Definition at line 355 of file io_factory.cpp.

std::list< Image > isis::data::IOFactory::load ( const util::slist paths,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Load data from a set of files or directories with given paths and dialect.

Parameters:
pathslist if files or directories to load
suffix_overrideoverride the given suffix with this one (especially if there's no suffix)
dialectdialect of the fileformat to load
Returns:
list of images created from the loaded data
Note:
the images a re created from all loaded files, so loading mutilple files can very well result in only one image

Definition at line 342 of file io_factory.cpp.

size_t isis::data::IOFactory::load ( std::list< data::Chunk > &  chunks,
const std::string &  path,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Load a data file with given filename and dialect into a chunklist.

Parameters:
chunkslist to store the loaded chunks in
pathfile or directory to load
suffix_overrideoverride the given suffix with this one (especially if there's no suffix)
dialectdialect of the fileformat to load
Returns:
list of chunks (part of an image)

Definition at line 329 of file io_factory.cpp.

size_t isis::data::IOFactory::loadFile ( std::list< Chunk > &  ret,
const boost::filesystem::path &  filename,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [protected]

Definition at line 217 of file io_factory.cpp.

size_t isis::data::IOFactory::loadPath ( std::list< Chunk > &  ret,
const boost::filesystem::path &  path,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [protected]

Definition at line 360 of file io_factory.cpp.

bool isis::data::IOFactory::registerFileFormat ( const FileFormatPtr  plugin) [protected]

Definition at line 125 of file io_factory.cpp.

void isis::data::IOFactory::setProgressFeedback ( boost::shared_ptr< util::ProgressFeedback feedback) [static]

Definition at line 429 of file io_factory.cpp.

bool isis::data::IOFactory::write ( std::list< data::Image images,
const std::string &  path,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Definition at line 390 of file io_factory.cpp.

bool isis::data::IOFactory::write ( const data::Image image,
const std::string &  path,
util::istring  suffix_override = "",
util::istring  dialect = "" 
) [static]

Definition at line 384 of file io_factory.cpp.


Friends And Related Function Documentation

friend class util::Singletons [friend]

Definition at line 42 of file io_factory.hpp.


Field Documentation

Definition at line 103 of file io_factory.hpp.


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