Exiv2::CommentValue Class Reference

Value for an Exif comment. More...

#include <value.hpp>

Inheritance diagram for Exiv2::CommentValue:

Inheritance graph
[legend]
Collaboration diagram for Exiv2::CommentValue:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::auto_ptr< CommentValueAutoPtr
 Shortcut for a CommentValue auto pointer.
enum  CharsetId {
  ascii, jis, unicode, undefined,
  invalidCharsetId, lastCharsetId
}
 Character set identifiers for the character sets defined by Exif.

Public Member Functions

Creators
 CommentValue ()
 Default constructor.
 CommentValue (const std::string &comment)
 Constructor, uses read(const std::string& comment).
virtual ~CommentValue ()
 Virtual destructor.
Manipulators
int read (const std::string &comment)
 Read the value from a comment.
virtual int read (const std::string &buf)
 Read the value from buf. This default implementation uses buf as it is.
virtual int read (const byte *buf, long len, ByteOrder byteOrder=invalidByteOrder)
 Read the value from a character buffer.
Accessors
AutoPtr clone () const
 Return an auto-pointer to a copy of itself (deep copy). The caller owns this copy and the auto-pointer ensures that it will be deleted.
std::ostream & write (std::ostream &os) const
 Write the comment in a format which can be read by read(const std::string& comment).
std::string comment () const
 Return the comment (without a charset="..." prefix).
CharsetId charsetId () const
 Return the charset id of the comment.

Detailed Description

Value for an Exif comment.

This can be a plain Ascii string or a multipe byte encoded string. The comment is expected to be encoded in the character set indicated (default undefined), but this is not checked. It is left to caller to decode and encode the string to and from readable text if that is required.


Member Function Documentation

virtual int Exiv2::StringValueBase::read const byte buf,
long  len,
ByteOrder  byteOrder = invalidByteOrder
 

Read the value from a character buffer.

Note:
The byte order is required by the interface but not used by this method, so just use the default.
Parameters:
buf Pointer to the data buffer to read from
len Number of bytes in the data buffer
byteOrder Byte order. Not needed.
Returns:
0 if successful.

int Exiv2::CommentValue::read const std::string &  comment  )  [virtual]
 

Read the value from a comment.

The format of comment is:
[charset=["]Ascii|Jis|Unicode|Undefined["] ]comment
The default charset is Undefined.

Returns:
0 if successful
1 if an invalid character set is encountered

Reimplemented from Exiv2::StringValueBase.


The documentation for this class was generated from the following file:
Generated on Thu Dec 31 03:58:11 2009 for Exiv2 by  doxygen 1.3.9.1