Overview | Namespace | Class | Index | Help

PUBLIC MEMBERS: | CLASSES | STRUCTS | UNIONS | ENUMS | TYPEDEFS | METHODS | STATIC METHODS | DATA | STATIC DATA

:: 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 ) throw( ); | Constructor: Creates a copy of given data bytes.
  ByteSequence( sal_Int32 len ) throw( ); | Constructor: Creates sequence of given length and initializes all bytes to 0.
  ByteSequence( sal_Int32 len, __ByteSequence_NoDefault nodefault ) throw( ); | 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( ) throw( ); |
  sal_Int8 & operator[]( sal_Int32 nIndex ) throw( ); |
  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 ) throw( ); |
  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

Copyright © 2003 Sun Microsystems, Inc.