Language:

The Free and Open Productivity Suite
Apache OpenOffice 4.1.4 released

Developer's Guide

API

SDK

Tips 'n' Tricks

Miscellaneous


:: rtl ::

class ByteSequence


Base Classes
None.
Known Derived Classes
None.

virtual abstract interface template
NO NO NO NO
Description
C++ class representing a SAL byte sequence. C++ Sequences are reference counted and shared, so the sequence keeps a handle to its data. To keep value semantics, copies are only generated if the sequence is to be modified (new handle).
File
byteseq.h

Public Members

Enums

__ByteSequence_NoDefault
__ByteSequence_NoAcquire

Methods


ByteSequence( ) throw( );
Default constructor: Creates an empty sequence.

ByteSequence( const ByteSequence & rSeq ) throw( );
Copy constructor: Creates a copy of given sequence.

ByteSequence( sal_Sequence * pSequence ) throw( );
Copy constructor Creates a copy from the C-Handle.

ByteSequence( const sal_Int8 * pElements, sal_Int32 len );
Constructor: Creates a copy of given data bytes.

ByteSequence( sal_Int32 len );
Constructor: Creates sequence of given length and initializes all bytes to 0.

ByteSequence( sal_Int32 len, __ByteSequence_NoDefault nodefault );
Constructor: Creates sequence of given length and does NOT initialize data. Use this ctor for performance optimization only.

ByteSequence( sal_Sequence * pSequence, __ByteSequence_NoAcquire noacquire ) throw( );

~ByteSequence( ) throw( );
Destructor: Releases sequence handle. Last handle will free memory.
ByteSequence &
operator=( const ByteSequence & rSeq ) throw( );
Assignment operator: Acquires given sequence handle and releases a previously set handle.
sal_Int32
getLength( ) const throw( );
Gets the length of sequence.
const sal_Int8 *
getConstArray( ) const throw( );
Gets a pointer to byte array for READING. If the sequence has a length of 0, then the returned pointer is undefined.
sal_Int8 *
getArray( );
sal_Int8 &
operator[]( sal_Int32 nIndex );
const sal_Int8 &
operator[]( sal_Int32 nIndex ) const throw( );
Const index operator: Obtains a reference to byte indexed at given position. The implementation does NOT check for array bounds!
sal_Bool
operator==( const ByteSequence & rSeq ) const throw( );
Equality operator: Compares two sequences.
sal_Bool
operator!=( const ByteSequence & rSeq ) const throw( );
Unequality operator: Compares two sequences.
void
realloc( sal_Int32 nSize );
sal_Sequence *
getHandle( ) const throw( );
Returns the UNnacquired C handle of the sequence
sal_Sequence *
get( ) const throw( );
Returns the UNnacquired C handle of the sequence (for compatibility reasons)

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache and the Apache feather logo are trademarks of The Apache Software Foundation. OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.