LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
Classes | Namespaces | Enumerations | Functions
byteseq.h File Reference
#include "sal/config.h"
#include "rtl/alloc.h"
#include "sal/saldllapi.h"
#include "sal/types.h"

Go to the source code of this file.

Classes

class  rtl::ByteSequence
 C++ class representing a SAL byte sequence. More...
 

Namespaces

 rtl
 

Enumerations

enum  rtl::__ByteSequence_NoDefault { rtl::BYTESEQ_NODEFAULT = 0xcafe }
 
enum  rtl::__ByteSequence_NoAcquire { rtl::BYTESEQ_NOACQUIRE }
 

Functions

SAL_DLLPUBLIC void rtl_byte_sequence_reference2One (sal_Sequence **ppSequence) SAL_THROW_EXTERN_C()
 Assures that the reference count of the given byte sequence is one. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_realloc (sal_Sequence **ppSequence, sal_Int32 nSize) SAL_THROW_EXTERN_C()
 Reallocates length of byte sequence. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_acquire (sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
 Acquires the byte sequence. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_release (sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
 Releases the byte sequence. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_construct (sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
 Constructs a bytes sequence with length nLength. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_constructNoDefault (sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
 Constructs a bytes sequence with length nLength. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_constructFromArray (sal_Sequence **ppSequence, const sal_Int8 *pData, sal_Int32 nLength) SAL_THROW_EXTERN_C()
 Constructs a byte sequence with length nLength and copies nLength bytes from pData. More...
 
SAL_DLLPUBLIC void rtl_byte_sequence_assign (sal_Sequence **ppSequence, sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
 Assigns the byte sequence pSequence to *ppSequence. More...
 
SAL_DLLPUBLIC sal_Bool rtl_byte_sequence_equals (sal_Sequence *pSequence1, sal_Sequence *pSequence2) SAL_THROW_EXTERN_C()
 Compares two byte sequences. More...
 
SAL_DLLPUBLIC const sal_Int8rtl_byte_sequence_getConstArray (sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
 Returns the data array pointer of the sequence. More...
 
SAL_DLLPUBLIC sal_Int32 rtl_byte_sequence_getLength (sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
 Returns the length of the sequence. More...
 

Function Documentation

◆ rtl_byte_sequence_acquire()

SAL_DLLPUBLIC void rtl_byte_sequence_acquire ( sal_Sequence pSequence)

Acquires the byte sequence.

Parameters
pSequencesequence, that is to be acquired

◆ rtl_byte_sequence_assign()

SAL_DLLPUBLIC void rtl_byte_sequence_assign ( sal_Sequence **  ppSequence,
sal_Sequence pSequence 
)

Assigns the byte sequence pSequence to *ppSequence.

Parameters
ppSequenceinout sequence; on entry *ppSequence may be null, otherwise it is released; after the call, *ppSequence references pSequence
pSequencethe source sequence

◆ rtl_byte_sequence_construct()

SAL_DLLPUBLIC void rtl_byte_sequence_construct ( sal_Sequence **  ppSequence,
sal_Int32  nLength 
)

Constructs a bytes sequence with length nLength.

All bytes are set to zero.

Parameters
ppSequenceinout sequence; on entry *ppSequence may be null, otherwise it is released; after the call, *ppSequence contains the newly constructed sequence
nLengthlength of new sequence

◆ rtl_byte_sequence_constructFromArray()

SAL_DLLPUBLIC void rtl_byte_sequence_constructFromArray ( sal_Sequence **  ppSequence,
const sal_Int8 pData,
sal_Int32  nLength 
)

Constructs a byte sequence with length nLength and copies nLength bytes from pData.

Parameters
ppSequenceinout sequence; on entry *ppSequence may be null, otherwise it is released; after the call, *ppSequence contains the newly constructed sequence
pDatainitial data
nLengthlength of new sequence

◆ rtl_byte_sequence_constructNoDefault()

SAL_DLLPUBLIC void rtl_byte_sequence_constructNoDefault ( sal_Sequence **  ppSequence,
sal_Int32  nLength 
)

Constructs a bytes sequence with length nLength.

The data is not initialized.

Parameters
ppSequenceinout sequence; on entry *ppSequence may be null, otherwise it is released; after the call, *ppSequence contains the newly constructed sequence
nLengthlength of new sequence

◆ rtl_byte_sequence_equals()

SAL_DLLPUBLIC sal_Bool rtl_byte_sequence_equals ( sal_Sequence pSequence1,
sal_Sequence pSequence2 
)

Compares two byte sequences.

Returns
true, if the data within the sequences are identical; false otherwise

◆ rtl_byte_sequence_getConstArray()

SAL_DLLPUBLIC const sal_Int8* rtl_byte_sequence_getConstArray ( sal_Sequence pSequence)

Returns the data array pointer of the sequence.

Returns
read-pointer to the data array of the sequence. If rtl_byte_sequence_reference2One() has been called before, the pointer may be casted to a non const pointer and the sequence may be modified

◆ rtl_byte_sequence_getLength()

SAL_DLLPUBLIC sal_Int32 rtl_byte_sequence_getLength ( sal_Sequence pSequence)

Returns the length of the sequence.

Parameters
pSequencesequence handle
Returns
length of the sequence

◆ rtl_byte_sequence_realloc()

SAL_DLLPUBLIC void rtl_byte_sequence_realloc ( sal_Sequence **  ppSequence,
sal_Int32  nSize 
)

Reallocates length of byte sequence.

Parameters
ppSequencesequence
nSizenew size of sequence

◆ rtl_byte_sequence_reference2One()

SAL_DLLPUBLIC void rtl_byte_sequence_reference2One ( sal_Sequence **  ppSequence)

Assures that the reference count of the given byte sequence is one.

Otherwise a new copy of the sequence is created with a reference count of one.

Parameters
ppSequencesequence

◆ rtl_byte_sequence_release()

SAL_DLLPUBLIC void rtl_byte_sequence_release ( sal_Sequence pSequence)

Releases the byte sequence.

If the refcount drops to zero, the sequence is freed.

Parameters
pSequencesequence, that is to be released; invalid after call