#include <klvobject.h>
Inheritance diagram for KLVObject:
Public Member Functions | |
KLVObject (ULPtr ObjectUL=NULL) | |
Build a new KLVObject. | |
virtual void | Init (void) |
Initialise newly built KLVObject. | |
virtual | ~KLVObject () |
virtual void | SetSource (MXFFilePtr File, Position Location=-1) |
Set the source details when an object has been read from a file. | |
virtual void | SetDestination (MXFFilePtr File, Position Location=-1) |
Set the destination details for the object to be written to a file. | |
virtual ULPtr | GetUL (void) |
Get the object's UL. | |
virtual void | SetUL (ULPtr NewUL) |
Set the object's UL. | |
virtual Position | GetLocation (void) |
Get the location within the ultimate parent. | |
virtual std::string | GetSource (void) |
Get text that describes where this item came from. | |
std::string | GetSourceLocation (void) |
Get text that describes exactly where this item came from. | |
virtual Int32 | GetKLSize (void) |
Get the size of the key and length (not of the value). | |
virtual void | SetKLSize (Int32 NewKLSize) |
Set the size of the key and length (not of the value). | |
virtual GCElementKind | GetGCElementKind (void) |
Get a GCElementKind structure. | |
virtual UInt32 | GetGCTrackNumber (void) |
Get the track number of this KLVObject (if it is a GC KLV, else 0). | |
virtual Position | GetDataBase (void) |
Get the position of the first byte in the DataChunk as an offset into the file. | |
virtual void | SetDataBase (Position NewBase) |
Set the position of the first byte in the DataChunk as an offset into the file. | |
virtual Int32 | ReadKL (void) |
Read the key and length for this KLVObject from the current source. | |
Int32 | Base_ReadKL (void) |
Base verion: Read the key and length for this KLVObject from the current source. | |
virtual size_t | ReadData (size_t Size=static_cast< size_t >(-1)) |
Read data from the start of the KLV value into the current DataChunk. | |
virtual size_t | ReadDataFrom (Position Offset, size_t Size=static_cast< size_t >(-1)) |
Read data from a specified position in the KLV value field into the DataChunk. | |
size_t | Base_ReadDataFrom (Position Offset, size_t Size=static_cast< size_t >(-1)) |
Base verion: Read data from a specified position in the KLV value field into the DataChunk. | |
size_t | Base_ReadDataFrom (DataChunk &Buffer, Position Offset, size_t Size=static_cast< size_t >(-1)) |
Base verion: Read data from a specified position in the KLV value field into the DataChunk. | |
virtual Int32 | WriteKL (Int32 LenSize=0) |
Write the key and length of the current DataChunk to the destination file. | |
Int32 | Base_WriteKL (Int32 LenSize=0, Length NewLength=-1) |
Base verion: Write the key and length of the current DataChunk to the destination file. | |
virtual size_t | WriteData (size_t Size=static_cast< size_t >(-1)) |
Write (some of) the current data to the same location in the destination file. | |
virtual size_t | WriteDataFrom (Position Start, size_t Size=static_cast< size_t >(-1)) |
Write (some of) the current data to the same location in the destination file. | |
virtual size_t | WriteDataTo (Position Offset, size_t Size=static_cast< size_t >(-1)) |
Write (some of) the current data to a different location in the destination file. | |
virtual size_t | WriteDataFromTo (Position Offset, Position Start, size_t Size=static_cast< size_t >(-1)) |
Write (some of) the current data to the same location in the destination file. | |
virtual size_t | WriteDataTo (const UInt8 *Buffer, Position Offset, size_t Size) |
Write data from a given buffer to a given location in the destination file. | |
size_t | Base_WriteDataTo (const UInt8 *Buffer, Position Offset, size_t Size) |
Base verion: Write data from a given buffer to a given location in the destination file. | |
virtual void | SetReadHandler (KLVReadHandlerPtr Handler) |
Set a handler to supply data when a read is performed. | |
virtual Length | GetLength (void) |
Get the length of the value field. | |
virtual void | SetLength (Length NewLength) |
Set the length of the value field. | |
virtual DataChunk & | GetData (void) |
Get a reference to the data chunk. | |
Protected Attributes | |
KLVInfo | Source |
Info on the source file. | |
KLVInfo | Dest |
Info on the destination file. | |
ULPtr | TheUL |
The UL for this object (if known). | |
Length | ValueLength |
Length of the value field. | |
DataChunk | Data |
The raw data for this item (if available). | |
Position | DataBase |
The offset of the first byte in the DataChunk from the start of the KLV value field. | |
KLVReadHandlerPtr | ReadHandler |
A read-handler to supply data in response to read requests. If NULL data will be read from SourceFile (if available). | |
Friends | |
class | KLVEObject |
Classes | |
class | KLVInfo |
This class gives access to single KLV items within an MXFfile. The normal use for this class is handling of essence data. Huge values can be safely handled by loading them a "chunk" at a time. Data is also available to identify the location of the value in an MXFFile so that MXFFile::Read() and MXFFile::Write can be used for efficient access.
virtual ~KLVObject | ( | ) | [inline, virtual] |
void Init | ( | void | ) | [virtual] |
virtual void SetSource | ( | MXFFilePtr | File, | |
Position | Location = -1 | |||
) | [inline, virtual] |
Set the source details when an object has been read from a file.
File | The source file of this KLVObject | |
Location | The byte offset of the start of the key of the KLV from the start of the file (current position if -1) |
virtual void SetDestination | ( | MXFFilePtr | File, | |
Position | Location = -1 | |||
) | [inline, virtual] |
Set the destination details for the object to be written to a file.
File | The destination file of this KLVObject | |
Location | The byte offset of the start of the key of the KLV from the start of the file, if omitted (or -1) the current position in that file will be used |
virtual ULPtr GetUL | ( | void | ) | [inline, virtual] |
virtual void SetUL | ( | ULPtr | NewUL | ) | [inline, virtual] |
virtual Position GetLocation | ( | void | ) | [inline, virtual] |
Get the location within the ultimate parent.
std::string GetSource | ( | void | ) | [virtual] |
std::string GetSourceLocation | ( | void | ) | [inline] |
Get text that describes exactly where this item came from.
virtual Int32 GetKLSize | ( | void | ) | [inline, virtual] |
virtual void SetKLSize | ( | Int32 | NewKLSize | ) | [inline, virtual] |
Set the size of the key and length (not of the value).
This will be used when writing to the destination (if possible) - you cannot change the "source" KLSize
virtual GCElementKind GetGCElementKind | ( | void | ) | [inline, virtual] |
virtual UInt32 GetGCTrackNumber | ( | void | ) | [inline, virtual] |
virtual Position GetDataBase | ( | void | ) | [inline, virtual] |
Get the position of the first byte in the DataChunk as an offset into the file.
virtual void SetDataBase | ( | Position | NewBase | ) | [inline, virtual] |
Set the position of the first byte in the DataChunk as an offset into the file.
virtual Int32 ReadKL | ( | void | ) | [inline, virtual] |
Read the key and length for this KLVObject from the current source.
Reimplemented in KLVEObject.
Int32 Base_ReadKL | ( | void | ) |
Base verion: Read the key and length for this KLVObject from the current source.
virtual size_t ReadData | ( | size_t | Size = static_cast<size_t>(-1) |
) | [inline, virtual] |
Read data from the start of the KLV value into the current DataChunk.
Size | Number of bytes to read, if -1 all available bytes will be read (which could be billions!) |
Reimplemented in KLVEObject.
virtual size_t ReadDataFrom | ( | Position | Offset, | |
size_t | Size = static_cast<size_t>(-1) | |||
) | [inline, virtual] |
Read data from a specified position in the KLV value field into the DataChunk.
Offset | Offset from the start of the KLV value from which to start reading | |
Size | Number of bytes to read, if -1 all available bytes will be read (which could be billions!) |
Reimplemented in KLVEObject.
size_t Base_ReadDataFrom | ( | Position | Offset, | |
size_t | Size = static_cast<size_t>(-1) | |||
) | [inline] |
Base verion: Read data from a specified position in the KLV value field into the DataChunk.
Offset | Offset from the start of the KLV value from which to start reading | |
Size | Number of bytes to read, if -1 all available bytes will be read (which could be billions!) |
size_t Base_ReadDataFrom | ( | DataChunk & | Buffer, | |
Position | Offset, | |||
size_t | Size = static_cast< size_t >(-1) | |||
) |
Base verion: Read data from a specified position in the KLV value field into the DataChunk.
Offset | Offset from the start of the KLV value from which to start reading | |
Size | Number of bytes to read, if -1 all available bytes will be read (which could be billions!) |
Write the key and length of the current DataChunk to the destination file.
The key and length will be written to the source file as set by SetSource. If LenSize is zero the length will be formatted to match KLSize (if possible!)
Reimplemented in KLVEObject.
Base verion: Write the key and length of the current DataChunk to the destination file.
The key and length will be written to the source file as set by SetSource. If LenSize is zero the length will be formatted to match KLSize (if possible!). The length written can be overridden by using parameter NewLength
DRAGONS: This base function may be called from derived class objects to get base behaviour. It is therefore vital that the function does not call any "virtual" KLVObject functions, directly or indirectly.
virtual size_t WriteData | ( | size_t | Size = static_cast<size_t>(-1) |
) | [inline, virtual] |
Write (some of) the current data to the same location in the destination file.
Size | The number of bytes to write, if -1 all available bytes will be written |
Reimplemented in KLVEObject.
virtual size_t WriteDataFrom | ( | Position | Start, | |
size_t | Size = static_cast<size_t>(-1) | |||
) | [inline, virtual] |
Write (some of) the current data to the same location in the destination file.
Start | The offset within the current DataChunk of the first byte to write | |
Size | The number of bytes to write, if -1 all available bytes will be written |
Reimplemented in KLVEObject.
virtual size_t WriteDataTo | ( | Position | Offset, | |
size_t | Size = static_cast<size_t>(-1) | |||
) | [inline, virtual] |
Write (some of) the current data to a different location in the destination file.
Offset | The offset within the KLV value field of the first byte to write | |
Size | The number of bytes to write, if <= 0 all available bytes will be written |
Reimplemented in KLVEObject.
virtual size_t WriteDataFromTo | ( | Position | Offset, | |
Position | Start, | |||
size_t | Size = static_cast<size_t>(-1) | |||
) | [inline, virtual] |
Write (some of) the current data to the same location in the destination file.
Offset | The offset within the KLV value field of the first byte to write | |
Start | The offset within the current DataChunk of the first byte to write | |
Size | The number of bytes to write, if -1 all available bytes will be written |
Reimplemented in KLVEObject.
Write data from a given buffer to a given location in the destination file.
Buffer | Pointer to data to be written | |
Offset | The offset within the KLV value field of the first byte to write | |
Size | The number of bytes to write |
Reimplemented in KLVEObject.
Base verion: Write data from a given buffer to a given location in the destination file.
Buffer | Pointer to data to be written | |
Offset | The offset within the KLV value field of the first byte to write | |
Size | The number of bytes to write |
virtual void SetReadHandler | ( | KLVReadHandlerPtr | Handler | ) | [inline, virtual] |
Set a handler to supply data when a read is performed.
virtual Length GetLength | ( | void | ) | [inline, virtual] |
Get the length of the value field.
Reimplemented in KLVEObject.
virtual void SetLength | ( | Length | NewLength | ) | [inline, virtual] |
virtual DataChunk& GetData | ( | void | ) | [inline, virtual] |
Get a reference to the data chunk.
friend class KLVEObject [friend] |
Length ValueLength [protected] |
Length of the value field.
The offset of the first byte in the DataChunk from the start of the KLV value field.
KLVReadHandlerPtr ReadHandler [protected] |
A read-handler to supply data in response to read requests. If NULL data will be read from SourceFile (if available).