Loading...
Searching...
No Matches
Exiv2::XPathIo Class Reference

Provides binary IO for the data from stdin and data uri path. More...

`#include <basicio.hpp>`

Inheritance diagram for Exiv2::XPathIo:
[legend]

## Public Member Functions

Creators
| XPathIo (const std::string &orgPath)
| Default constructor that reads data from stdin/data uri path and writes them to the temp file.
virtual | ~XPathIo ()
| Destructor. Releases all managed memory and removes the temp file.
Manipulators
virtual void | transfer (BasicIo &src)
| Change the name of the temp file and make it untemporary before calling the method of superclass FileIo::transfer.
Public Member Functions inherited from Exiv2::FileIo
| FileIo (const std::string &path)
| Constructor that accepts the file path on which IO will be performed. The constructor does not open the file, and therefore never failes.
virtual | ~FileIo ()
| Destructor. Flushes and closes an open file.
int | open (const std::string &mode)
| Open the file using using the specified mode.
virtual int | open ()
| Open the file using using the default access mode of "rb". This method can also be used to "reopen" a file which will flush any unwritten data and reset the IO position to the start.
virtual int | close ()
| Flush and unwritten data and close the file . It is safe to call close on an already closed instance.
virtual long | write (const byte *data, long wcount)
| Write data to the file. The file position is advanced by the number of bytes written.
virtual long | write (BasicIo &src)
| Write data that is read from another BasicIo instance to the file. The file position is advanced by the number of bytes written.
virtual int | putb (byte data)
| Write one byte to the file. The file position is advanced by one byte.
virtual DataBuf | read (long rcount)
| Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read.
virtual long | read (byte *buf, long rcount)
| Read data from the file. Reading starts at the current file position and the position is advanced by the number of bytes read.
virtual int | getb ()
| Read one byte from the file. The file position is advanced by one byte.
virtual int | seek (long offset, Position pos)
| Move the current file position.
virtual byte * | mmap (bool isWriteable=false)
| Map the file into the process's address space. The file must be open before mmap() is called. If the mapped area is writeable, changes may not be written back to the underlying file until munmap() is called. The pointer is valid only as long as the FileIo object exists.
virtual int | munmap ()
| Remove a mapping established with mmap(). If the mapped area is writeable, this ensures that changes are written back to the underlying file.
virtual void | setPath (const std::string &path)
| close the file source and set a new path.
virtual long | tell () const
| Get the current file position.
virtual size_t | size () const
| Flush any buffered writes and get the current file size in bytes.
virtual bool | isopen () const
| Returns true if the file is open, otherwise false.
virtual int | error () const
| Returns 0 if the file is in a valid state, otherwise nonzero.
virtual bool | eof () const
| Returns true if the file position has reached the end, otherwise false.
virtual std::string | path () const
| Returns the path of the file.
virtual void | populateFakeData ()
| Mark all the bNone blocks to bKnow. This avoids allocating memory for parts of the file that contain image-date (non-metadata/pixel data)
Public Member Functions inherited from Exiv2::BasicIo
virtual | ~BasicIo ()
| Destructor.

## Static Public Attributes

static const std::string | TEMP_FILE_EXT = ".exiv2_temp"
| The extension of the temporary file which is created when getting input data to read metadata. This file will be deleted in destructor.
static const std::string | GEN_FILE_EXT = ".exiv2"
| The extension of the generated file which is created when getting input data to add or modify the metadata.

## Static methods

static std::string | writeDataToFile (const std::string &orgPath)
| Read the data from stdin/data uri path and write them to the file.

## Additional Inherited Members

Public Types inherited from Exiv2::BasicIo
enum | Position { beg , cur , end }
| Seek starting positions.
typedef std::auto_ptr< BasicIo > | AutoPtr
| BasicIo auto_ptr type.
Public Attributes inherited from Exiv2::BasicIo
byte * | bigBlock_
| this is allocated and populated by mmap()
Protected Member Functions inherited from Exiv2::BasicIo
| BasicIo ()
| Default Constructor.

## Detailed Description

Provides binary IO for the data from stdin and data uri path.

## Member Function Documentation

## transfer()

void Exiv2::XPathIo::transfer | ( | BasicIo & | src | ) |

virtual

Change the name of the temp file and make it untemporary before calling the method of superclass FileIo::transfer.

Reimplemented from Exiv2::FileIo.

References GEN_FILE_EXT, Exiv2::FileIo::path(), Exiv2::ReplaceStringInPlace(), Exiv2::FileIo::setPath(), TEMP_FILE_EXT, and Exiv2::FileIo::transfer().

## writeDataToFile()

std::string Exiv2::XPathIo::writeDataToFile | ( | const std::string & | orgPath | ) |

static

Read the data from stdin/data uri path and write them to the file.

Parameters

  orgPath | It equals "-" if the input data's from stdin. Otherwise, it's data uri path.

Returns
  the name of the new file.

Exceptions

  Error | if it fails.

References Exiv2::base64decode(), Exiv2::fileProtocol(), Exiv2::FileIo::path(), Exiv2::FileIo::size(), and TEMP_FILE_EXT.

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

- basicio.hpp
- basicio.cpp