Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

k_io_box.h File Reference

Functions to export & import header in box file format. More...

#include "kobjects.h"
#include "kerror.h"

Defines

#define KBOX_HEADER_LEN   4
 Header lenght.
#define KBox_addVar(pBox, var)   KBox_addDatas (pBox, &var, sizeof (var))
 Adds the given data to the box structure.
#define KBox_addString(pBox, sStr, iLen)   KBox_addDatas (pBox, sStr, sizeof (KChar) * iLen)
 Adds string data to the box structure.
#define KBox_toPKUChar(pBox, pBytes)   _KBox_toPKUChar (pBox, pBytes, knull)
 Converts the box in a bytes stream.

Functions

KTL_API KBox * KBox_create (KChar aHeader[KBOX_HEADER_LEN])
 Creates a KBox structure.
KTL_API KBool KBox_setHeader (KBox *pBox, KChar aHeader[KBOX_HEADER_LEN])
 Sets a header for a box.
KTL_API KBool KBox_setDatas (KBox *pBox, KUChar *pDatas, KUInt32 iBytes)
 Affects the given data to the box.
KTL_API KBool KBox_addDatas (KBox *pBox, KCPtr pDatas, KUInt32 iBytes)
 Adds the given data to the box structure.
KTL_API KBool KBox_insertDatas (KBox *pBox, KPtr pDatas, KUInt32 iBytes, KUInt32 iPos)
 Inserts the given data to the box structure.
KTL_API KBool KBox_copyDatas (KBox *pBox, KUChar *pDatas, KUInt32 iBytes)
 Copies the pointed data to the box structure.
KTL_API KUCharKBox_getDatas (KBox *pBox, KUInt32 *iBytes)
 Gets the data pointer field of a box structure.
KTL_API KUCharKBox_cloneDatas (KBox *pBox, KUInt32 *iBytes)
 Gets a copy of the data pointer field of a box structure.
KTL_API KBool KBox_addSubBox (KBox *pBox, KBox *pSubBox)
 Adds a sub box to the box structure.
KTL_API KBool KBox_insertSubBox (KBox *pBox, KBox *pSubBox, KUInt32 iIndex)
 Inserts a sub box to the box structure.
KTL_API KBool KBox_replaceSubBox (KBox *pBox, KBox *pSubBox, KUInt32 iIndex)
 Replaces a sub box in the box structure.
KTL_API KBox * KBox_getSubBox (KBox *pBox, KUInt32 iIndex)
 Gets a sub box to the box structure.
KTL_API KUInt32 KBox_getSubBoxCount (KBox *pBox)
 Gets the number of sub box in a box structure.
KTL_API KUInt32 KBox_getBytes (KBox *pBox)
 Gets the size in bytes of a box structure.
KTL_API KUChar_KBox_toPKUChar (KBox *pBox, KUInt32 *pBytes, KUChar *pCurrentStream)
 Converts the box in a bytes stream.


Detailed Description

Functions to export & import header in box file format.

Version:
KToolLib-2.0
Author:
Fabien Gallot
Date:
15/04/2009
Note:
Copyright © 2008-2010 iKlax Media SAS (www.iklaxmedia.com). All rights reserved.

Define Documentation

#define KBox_addString pBox,
sStr,
iLen   )     KBox_addDatas (pBox, sStr, sizeof (KChar) * iLen)
 

Adds string data to the box structure.

Copies only the number of bytes specified as parameter. Updates the data size.

Parameters:
pBox the box structure
sStr the string data
iLen the string length
Returns:
ktrue if successful otherwise kfalse

#define KBox_addVar pBox,
var   )     KBox_addDatas (pBox, &var, sizeof (var))
 

Adds the given data to the box structure.

Updates the data size.

Parameters:
pBox the box structure
var the data pointer
Returns:
ktrue if successful otherwise kfalse

#define KBOX_HEADER_LEN   4
 

Header lenght.

In character...

#define KBox_toPKUChar pBox,
pBytes   )     _KBox_toPKUChar (pBox, pBytes, knull)
 

Converts the box in a bytes stream.

Parameters:
pBox the box structure
pBytes a refernce to a pointer to a bytes stream
Returns:
a bytes stream


Function Documentation

KTL_API KUChar* _KBox_toPKUChar KBox *  pBox,
KUInt32 pBytes,
KUChar pCurrentStream
 

Converts the box in a bytes stream.

Warning:
Do not use this function but prefer 'KBox_toPKUChar'
Parameters:
pBox the box structure
pBytes a refernce to a pointer to a bytes stream
pCurrentStream the current bytes stream
Returns:
a bytes stream

KTL_API KBool KBox_addDatas KBox *  pBox,
KCPtr  pDatas,
KUInt32  iBytes
 

Adds the given data to the box structure.

Copies only the number of bytes specified as parameter. Updates the data size.

Parameters:
pBox the box structure
pDatas the data pointer
iBytes the size in Bytes of the data to be added
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KBox_addSubBox KBox *  pBox,
KBox *  pSubBox
 

Adds a sub box to the box structure.

Parameters:
pBox the box structure
pSubBox the sub box structure to be added
Returns:
ktrue if successful otherwise kfalse

KTL_API KUChar* KBox_cloneDatas KBox *  pBox,
KUInt32 iBytes
 

Gets a copy of the data pointer field of a box structure.

The returned pointer must be deleted

Parameters:
pBox the box structure
iBytes the pointer to the data size to be obtained. This pointer must be allocated and will be initialized by the function if successful
Returns:
a pointer to the box data field if successful otherwise knull

KTL_API KBool KBox_copyDatas KBox *  pBox,
KUChar pDatas,
KUInt32  iBytes
 

Copies the pointed data to the box structure.

Copies only the number of bytes specified as parameter.

Parameters:
pBox the box structure
pDatas the data pointer
iBytes the size in bytes of the data to be copied
Returns:
ktrue if successful otherwise kfalse

KTL_API KBox* KBox_create KChar  aHeader[KBOX_HEADER_LEN]  ) 
 

Creates a KBox structure.

Parameters:
aHeader the header of the box
Returns:
the created KBox structure

KTL_API KUInt32 KBox_getBytes KBox *  pBox  ) 
 

Gets the size in bytes of a box structure.

This size includes both the data size and the sub boxes size. This size do not include the header box size.

Parameters:
pBox the box structure
Returns:
the number of bytes of the box structure if successful otherwise 0

KTL_API KUChar* KBox_getDatas KBox *  pBox,
KUInt32 iBytes
 

Gets the data pointer field of a box structure.

The returned pointer must not be deleted

Parameters:
pBox the box structure
iBytes the pointer to the data size to be obtained. This pointer must be allocated and will be initialized by the function if successful
Returns:
a pointer to the box data field if successful otherwise knull

KTL_API KBox* KBox_getSubBox KBox *  pBox,
KUInt32  iIndex
 

Gets a sub box to the box structure.

Parameters:
pBox the box structure
iIndex the index of the sub box to be obtained
Returns:
the pointer to the sub box if successful otherwise knull

KTL_API KUInt32 KBox_getSubBoxCount KBox *  pBox  ) 
 

Gets the number of sub box in a box structure.

Parameters:
pBox the box structure
Returns:
the number of sub box

KTL_API KBool KBox_insertDatas KBox *  pBox,
KPtr  pDatas,
KUInt32  iBytes,
KUInt32  iPos
 

Inserts the given data to the box structure.

Copies only the number of bytes specified as parameter at the position also specified. If the box data field is too small then the function returns kfalse. The data size of the box is not updating.

Parameters:
pBox the box structure
pDatas the data pointer
iBytes the size in bytes of the data to be inserted
iPos the position in bytes where the data is inserted
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KBox_insertSubBox KBox *  pBox,
KBox *  pSubBox,
KUInt32  iIndex
 

Inserts a sub box to the box structure.

Parameters:
pBox the box structure
pSubBox the sub box structure to be inserted
iIndex the index where the sub box must be inserted
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KBox_replaceSubBox KBox *  pBox,
KBox *  pSubBox,
KUInt32  iIndex
 

Replaces a sub box in the box structure.

Parameters:
pBox the box structure
pSubBox the sub box to be replaced
iIndex the index of the box to be replaced
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KBox_setDatas KBox *  pBox,
KUChar pDatas,
KUInt32  iBytes
 

Affects the given data to the box.

Copies only the data pointer. Updates the data size.

Parameters:
pBox the box structure
pDatas the data pointer
iBytes the number of bytes of the pointed data
Returns:
ktrue if successful otherwise kfalse

KTL_API KBool KBox_setHeader KBox *  pBox,
KChar  aHeader[KBOX_HEADER_LEN]
 

Sets a header for a box.

Parameters:
pBox the concerned box structure
aHeader the Header of the box
Returns:
ktrue if successful otherwise kfalse


Generated on Tue Mar 9 10:49:29 2010 for iKlax Tools Library (KToolLib) by doxygen 1.3.8