oln::io::internal::try_writers< W, T > Struct Template Reference

Image's writer. More...

#include <image_write.hh>

List of all members.

Static Public Member Functions

static bool by_extension (const T &input, std::ostream &out, const std::string &ext)
 Write object on the stream. Try do deduce the image format from the extension.
static bool by_data (const T &input, std::ostream &out, const std::string &ext)
 Try to match the file format referring to the data only.


Detailed Description

template<writer_id W, typename T>
struct oln::io::internal::try_writers< W, T >

Image's writer.

Parameters:
W Type of writer.

Definition at line 58 of file image_write.hh.


Member Function Documentation

template<writer_id W, typename T>
static bool oln::io::internal::try_writers< W, T >::by_extension ( const T &  input,
std::ostream &  out,
const std::string &  ext 
) [inline, static]

Write object on the stream. Try do deduce the image format from the extension.

Definition at line 68 of file image_write.hh.

00069         {
00070           if (image_writer<W,T>::knows_ext(ext))
00071             if (image_writer<W,T>::write(out, input))
00072               return true;
00073           return try_writers<writer_id(unsigned(W)-1), T>
00074                    ::by_extension(input, out, ext);
00075         }

template<writer_id W, typename T>
static bool oln::io::internal::try_writers< W, T >::by_data ( const T &  input,
std::ostream &  out,
const std::string &  ext 
) [inline, static]

Try to match the file format referring to the data only.

Definition at line 83 of file image_write.hh.

00084         {
00085           if (image_writer<W,T>::write(out, input))
00086             {
00087               // std::clog << "[ambiguous extension '" << ext
00088               //        << "' wrote as " << image_writer<W,T>::name() << "] "
00089               //        << std::flush;
00090               return true;
00091             }
00092           return try_writers<writer_id(unsigned(W)-1), T>
00093 	           ::by_data(input, out, ext);
00094         }


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