|
static BasicIo::AutoPtr | createIo (const std::string &path, bool useCurl=true) |
| Create the appropriate class type implemented BasicIo based on the protocol of the input. More...
|
|
static Image::AutoPtr | open (const std::string &path, bool useCurl=true) |
| Create an Image subclass of the appropriate type by reading the specified file. Image type is derived from the file contents. More...
|
|
static Image::AutoPtr | open (const byte *data, long size) |
| Create an Image subclass of the appropriate type by reading the provided memory. Image type is derived from the memory contents. More...
|
|
static Image::AutoPtr | open (BasicIo::AutoPtr io) |
| Create an Image subclass of the appropriate type by reading the provided BasicIo instance. Image type is derived from the data provided by io. The passed in io instance is (re)opened by this method. More...
|
|
static Image::AutoPtr | create (int type, const std::string &path) |
| Create an Image subclass of the requested type by creating a new image file. If the file already exists, it will be overwritten. More...
|
|
static Image::AutoPtr | create (int type) |
| Create an Image subclass of the requested type by creating a new image in memory. More...
|
|
static Image::AutoPtr | create (int type, BasicIo::AutoPtr io) |
| Create an Image subclass of the requested type by writing a new image to a BasicIo instance. If the BasicIo instance already contains data, it will be overwritten. More...
|
|
static int | getType (const std::string &path) |
| Returns the image type of the provided file. More...
|
|
static int | getType (const byte *data, long size) |
| Returns the image type of the provided data buffer. More...
|
|
static int | getType (BasicIo &io) |
| Returns the image type of data provided by a BasicIo instance. The passed in io instance is (re)opened by this method. More...
|
|
static AccessMode | checkMode (int type, MetadataId metadataId) |
| Returns the access mode or supported metadata functions for an image type and a metadata type. More...
|
|
static bool | checkType (int type, BasicIo &io, bool advance) |
| Determine if the content of io is an image of type. More...
|
|
Returns an Image instance of the specified type.
The factory is implemented as a static class.
bool Exiv2::ImageFactory::checkType |
( |
int |
type, |
|
|
BasicIo & |
io, |
|
|
bool |
advance |
|
) |
| |
|
static |
Determine if the content of io is an image of type.
The advance flag determines if the read position in the stream is moved (see below). This applies only if the type matches and the function returns true. If the type does not match, the stream position is not changed. However, if reading from the stream fails, the stream position is undefined. Consult the stream state to obtain more information in this case.
- Parameters
-
type | Type of the image. |
io | BasicIo instance to read from. |
advance | Flag indicating whether the position of the io should be advanced by the number of characters read to analyse the data (true) or left at its original position (false). This applies only if the type matches. |
- Returns
- true if the data matches the type of this class;
false if the data does not match
References Exiv2::find().
Referenced by Exiv2::Image::good().
BasicIo::AutoPtr Exiv2::ImageFactory::createIo |
( |
const std::string & |
path, |
|
|
bool |
useCurl = true |
|
) |
| |
|
static |
Create the appropriate class type implemented BasicIo based on the protocol of the input.
"-" path implies the data from stdin and it is handled by StdinIo. Http path can be handled by either HttpIo or CurlIo. Https, ftp paths are handled by CurlIo. Ssh, sftp paths are handled by SshIo. Others are handled by FileIo.
- Parameters
-
path | Image file. |
useCurl | Indicate whether the libcurl is used or not. If it's true, http is handled by CurlIo. Otherwise it is handled by HttpIo. |
- Returns
- An auto-pointer that owns an BasicIo instance.
- Exceptions
-
Error | If the file is not found or it is unable to connect to the server to read the remote file. |
References Exiv2::fileProtocol(), and Exiv2::pathOfFileUrl().
Referenced by open().