Add comments.
This commit is contained in:
parent
b6a4fd1c67
commit
9268279b47
@ -436,7 +436,21 @@ namespace Exiv2 {
|
||||
void encode(TiffEncoder& encoder, const Exifdatum* datum);
|
||||
//! Set the offset
|
||||
void setOffset(int32_t offset) { offset_ = offset; }
|
||||
//! Set pointer and size of the entry's data (not taking ownership of the data).
|
||||
/*!
|
||||
@brief Set pointer and size of the entry's data (not taking ownership of the data).
|
||||
|
||||
@param storage Usually, pData is a pointer into a copy of the image file, which
|
||||
means that it points to memory which is guaranteed to live longer
|
||||
than this class. However, sometimes pData is pointer into a
|
||||
DataBuf that was allocated by another node in the component tree.
|
||||
If so, we need to make sure that the DataBuf doesn't get freed too
|
||||
early. We use a std::shared_ptr to hold a reference to the DataBuf
|
||||
to ensure that it will be kept alive. The storage parameter is
|
||||
assigned to the storage_ field. In the more common scenario where
|
||||
pData points to a copy of the image, rather than a DataBuf, then
|
||||
you should pass std::shared_ptr<DataBuf>(), which is essentially
|
||||
a nullptr.
|
||||
*/
|
||||
void setData(byte* pData, int32_t size, const std::shared_ptr<DataBuf>& storage);
|
||||
/*!
|
||||
@brief Set the entry's data buffer. A shared_ptr is used to manage the DataBuf
|
||||
@ -533,6 +547,7 @@ namespace Exiv2 {
|
||||
TiffType tiffType,
|
||||
ByteOrder byteOrder);
|
||||
|
||||
//! Used (internally) to create another reference to the DataBuf reference by storage_.
|
||||
const std::shared_ptr<DataBuf>& storage() { return storage_; }
|
||||
|
||||
private:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user