AlterOffice
AlterOffice 3.4 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
byteseq.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 
3 #ifndef INCLUDED_RTL_BYTESEQ_H
4 #define INCLUDED_RTL_BYTESEQ_H
5 
6 #include "sal/config.h"
7 
8 #include "rtl/alloc.h"
9 #include "sal/saldllapi.h"
10 #include "sal/types.h"
11 
12 #ifdef __cplusplus
13 extern "C"
14 {
15 #endif
16 
23  sal_Sequence ** ppSequence )
25 
32  sal_Sequence ** ppSequence, sal_Int32 nSize )
34 
40  sal_Sequence *pSequence )
42 
48  sal_Sequence *pSequence )
50 
58  sal_Sequence **ppSequence , sal_Int32 nLength )
60 
68  sal_Sequence **ppSequence , sal_Int32 nLength )
70 
79  sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength )
81 
89  sal_Sequence **ppSequence , sal_Sequence *pSequence )
91 
97  sal_Sequence *pSequence1 , sal_Sequence *pSequence2 )
99 
107  sal_Sequence *pSequence )
109 
115 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_byte_sequence_getLength(
116  sal_Sequence *pSequence )
118 
119 #ifdef __cplusplus
120 }
121 namespace rtl
122 {
123 
125 {
129 };
130 
132 {
137 #if defined _MSC_VER
138  int(0xcafebabe)
139 #else
140  0xcafebabe
141 #endif
142 };
143 
150 {
153  sal_Sequence * _pSequence;
154 
155 public:
157  // these are here to force memory de/allocation to sal lib.
158  static void * SAL_CALL operator new ( size_t nSize )
159  { return ::rtl_allocateMemory( nSize ); }
160  static void SAL_CALL operator delete ( void * pMem )
161  { ::rtl_freeMemory( pMem ); }
162  static void * SAL_CALL operator new ( size_t, void * pMem )
163  { return pMem; }
164  static void SAL_CALL operator delete ( void *, void * )
165  {}
167 
170  inline ByteSequence();
175  inline ByteSequence( const ByteSequence & rSeq );
176 #if defined LIBO_INTERNAL_ONLY
177  inline ByteSequence( ByteSequence && rSeq ) noexcept;
178 #endif
179 
183  inline ByteSequence( sal_Sequence *pSequence );
189  inline ByteSequence( const sal_Int8 * pElements, sal_Int32 len );
194  inline ByteSequence( sal_Int32 len );
201  inline ByteSequence( sal_Int32 len , enum __ByteSequence_NoDefault nodefault );
211  inline ByteSequence( sal_Sequence *pSequence , enum __ByteSequence_NoAcquire noacquire );
214  inline ~ByteSequence();
215 
221  inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq );
222 #if defined LIBO_INTERNAL_ONLY
223  inline ByteSequence & operator = ( ByteSequence && rSeq ) noexcept;
224 #endif
225 
230  sal_Int32 SAL_CALL getLength() const
231  { return _pSequence->nElements; }
232 
238  const sal_Int8 * SAL_CALL getConstArray() const
239  { return reinterpret_cast<sal_Int8 *>(_pSequence->elements); }
247  inline sal_Int8 * SAL_CALL getArray();
248 
261  inline sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex );
262 
269  const sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex ) const
270  { return getConstArray()[ nIndex ]; }
271 
277  inline bool SAL_CALL operator == ( const ByteSequence & rSeq ) const;
283  inline bool SAL_CALL operator != ( const ByteSequence & rSeq ) const;
284 
291  inline void SAL_CALL realloc( sal_Int32 nSize );
292 
297  sal_Sequence * SAL_CALL getHandle() const
298  { return _pSequence; }
303  sal_Sequence * SAL_CALL get() const
304  { return _pSequence; }
305 };
306 
307 }
308 #endif
309 #endif
310 
311 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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.
SAL_DLLPUBLIC void rtl_byte_sequence_constructNoDefault(sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
Constructs a bytes sequence with length nLength.
unsigned char sal_Bool
Definition: types.h:18
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:93
__ByteSequence_NoAcquire
Definition: byteseq.h:131
SAL_DLLPUBLIC sal_Bool rtl_byte_sequence_equals(sal_Sequence *pSequence1, sal_Sequence *pSequence2) SAL_THROW_EXTERN_C()
Compares two byte sequences.
This enum value can be used to create a bytesequence from a C-Handle without acquiring the handle...
Definition: byteseq.h:136
CPPU_DLLPUBLIC void SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:567
SAL_DLLPUBLIC void rtl_byte_sequence_release(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Releases the byte sequence.
SAL_DLLPUBLIC const sal_Int8 * rtl_byte_sequence_getConstArray(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Returns the data array pointer of the sequence.
SAL_DLLPUBLIC void rtl_byte_sequence_realloc(sal_Sequence **ppSequence, sal_Int32 nSize) SAL_THROW_EXTERN_C()
Reallocates length of byte sequence.
__ByteSequence_NoDefault
Definition: byteseq.h:124
bool operator!=(const Any &rAny, const C &value)
Template inequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:653
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.
SAL_DLLPUBLIC void rtl_byte_sequence_assign(sal_Sequence **ppSequence, sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Assigns the byte sequence pSequence to *ppSequence.
SAL_DLLPUBLIC sal_Int32 rtl_byte_sequence_getLength(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Returns the length of the sequence.
This is the binary specification of a SAL sequence.
Definition: types.h:283
sal_Int32 getLength() const
Gets the length of sequence.
Definition: byteseq.h:230
SAL_DLLPUBLIC void rtl_byte_sequence_construct(sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
Constructs a bytes sequence with length nLength.
C++ class representing a SAL byte sequence.
Definition: byteseq.h:149
This enum value can be used to create a bytesequence with uninitialized data.
Definition: byteseq.h:128
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
signed char sal_Int8
Definition: types.h:23
const sal_Int8 * getConstArray() const
Gets a pointer to byte array for READING.
Definition: byteseq.h:238
SAL_DLLPUBLIC void rtl_byte_sequence_acquire(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Acquires the byte sequence.
sal_Sequence * getHandle() const
Returns the UNacquired C handle of the sequence.
Definition: byteseq.h:297
#define SAL_DLLPUBLIC
Definition: saldllapi.h:14