oln::io::internal::try_readers< R, T > Struct Template Reference

Image's reader. More...

#include <image_read.hh>

List of all members.

Static Public Member Functions

static bool by_extension (T &output, std::istream &in, const std::string &ext)
 Read an object from a stream. Try do deduce the image format from the extension.
static bool by_data (T &output, std::istream &in)
 Read an object from a stream. Try to match the file format referring to the data only.


Detailed Description

template<reader_id R, typename T>
struct oln::io::internal::try_readers< R, T >

Image's reader.

Parameters:
R Type of reader.

Definition at line 58 of file image_read.hh.


Member Function Documentation

template<reader_id R, typename T>
static bool oln::io::internal::try_readers< R, T >::by_extension ( T &  output,
std::istream &  in,
const std::string &  ext 
) [inline, static]

Read an object from a stream. Try do deduce the image format from the extension.

Definition at line 68 of file image_read.hh.

00069         {
00070           if (image_reader<R,T>::knows_ext(ext))
00071             if (image_reader<R,T>::read(in, output))
00072               return true;
00073           in.seekg(0, std::ios::beg);
00074           return try_readers<reader_id(unsigned(R)-1), T>
00075 	           ::by_extension(output, in, ext);
00076         }

template<reader_id R, typename T>
static bool oln::io::internal::try_readers< R, T >::by_data ( T &  output,
std::istream &  in 
) [inline, static]

Read an object from a stream. Try to match the file format referring to the data only.

Definition at line 85 of file image_read.hh.

00086         {
00087           if (image_reader<R,T>::read(in, output))
00088             return true;
00089           in.seekg(0, std::ios::beg);
00090           return try_readers<reader_id(unsigned(R)-1), T>::by_data(output, in);
00091         }


The documentation for this struct was generated from the following file:
Generated on Tue Feb 20 20:27:19 2007 for Olena by  doxygen 1.5.1