LibreOffice LibreOffice 4.3 SDK C/C++ API Reference

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19 #ifndef INCLUDED_RTL_BYTESEQ_H
20 #define INCLUDED_RTL_BYTESEQ_H
21
22 #include <sal/config.h>
23
24 #include <rtl/alloc.h>
25 #include <rtl/ustring.h>
26 #include <sal/saldllapi.h>
27 #include <sal/types.h>
28
29 #ifdef __cplusplus
30 extern "C"
31 {
32 #endif
33
39 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_reference2One(
40 sal_Sequence ** ppSequence )
41 SAL_THROW_EXTERN_C();
42
48 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_realloc(
49 sal_Sequence ** ppSequence, sal_Int32 nSize )
50 SAL_THROW_EXTERN_C();
51
56 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_acquire(
57 sal_Sequence *pSequence )
58 SAL_THROW_EXTERN_C();
59
64 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_release(
65 sal_Sequence *pSequence )
66 SAL_THROW_EXTERN_C();
67
74 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_construct(
75 sal_Sequence **ppSequence , sal_Int32 nLength )
76 SAL_THROW_EXTERN_C();
77
84 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_constructNoDefault(
85 sal_Sequence **ppSequence , sal_Int32 nLength )
86 SAL_THROW_EXTERN_C();
87
95 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_constructFromArray(
96 sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength )
97 SAL_THROW_EXTERN_C();
98
105 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_assign(
106 sal_Sequence **ppSequence , sal_Sequence *pSequence )
107 SAL_THROW_EXTERN_C();
108
113 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_byte_sequence_equals(
114 sal_Sequence *pSequence1 , sal_Sequence *pSequence2 )
115 SAL_THROW_EXTERN_C();
116
123 SAL_DLLPUBLIC const sal_Int8 *SAL_CALL rtl_byte_sequence_getConstArray(
124 sal_Sequence *pSequence )
125 SAL_THROW_EXTERN_C();
126
132 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_byte_sequence_getLength(
133 sal_Sequence *pSequence )
134 SAL_THROW_EXTERN_C();
135
136 #ifdef __cplusplus
137 }
138 namespace rtl
139 {
140
141 enum __ByteSequence_NoDefault
142 {
145 BYTESEQ_NODEFAULT = 0xcafe
146 };
147
148 enum __ByteSequence_NoAcquire
149 {
153 BYTESEQ_NOACQUIRE = 0xcafebabe
154 };
155
161 class SAL_WARN_UNUSED ByteSequence
162 {
165 sal_Sequence * _pSequence;
166
167 public:
169 // these are here to force memory de/allocation to sal lib.
170 inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(())
171 { return ::rtl_allocateMemory( nSize ); }
172 inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(())
173 { ::rtl_freeMemory( pMem ); }
174 inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(())
175 { return pMem; }
176 inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(())
177 {}
179
182 inline ByteSequence() SAL_THROW(());
187 inline ByteSequence( const ByteSequence & rSeq ) SAL_THROW(());
192 inline ByteSequence( sal_Sequence *pSequence ) SAL_THROW(());
198 inline ByteSequence( const sal_Int8 * pElements, sal_Int32 len );
203 inline ByteSequence( sal_Int32 len );
210 inline ByteSequence( sal_Int32 len , enum __ByteSequence_NoDefault nodefault );
220 inline ByteSequence( sal_Sequence *pSequence , enum __ByteSequence_NoAcquire noacquire ) SAL_THROW(());
223 inline ~ByteSequence() SAL_THROW(());
224
230 inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq ) SAL_THROW(());
231
236 inline sal_Int32 SAL_CALL getLength() const SAL_THROW(())
237 { return _pSequence->nElements; }
238
244 inline const sal_Int8 * SAL_CALL getConstArray() const SAL_THROW(())
245 { return (const sal_Int8 *)_pSequence->elements; }
253 inline sal_Int8 * SAL_CALL getArray();
254
267 inline sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex );
268
275 inline const sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex ) const SAL_THROW(())
276 { return getConstArray()[ nIndex ]; }
277
283 inline bool SAL_CALL operator == ( const ByteSequence & rSeq ) const SAL_THROW(());
289 inline bool SAL_CALL operator != ( const ByteSequence & rSeq ) const SAL_THROW(());
290
297 inline void SAL_CALL realloc( sal_Int32 nSize );
298
303 inline sal_Sequence * SAL_CALL getHandle() const SAL_THROW(())
304 { return _pSequence; }
309 inline sal_Sequence * SAL_CALL get() const SAL_THROW(())
310 { return _pSequence; }
311 };
312
313 }
314 #endif
315 #endif
316
317 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::__ByteSequence_NoAcquire
__ByteSequence_NoAcquire
Definition: byteseq.h:148
com::sun::star::uno::operator!=
bool operator!=(const Any &rAny, const C &value) SAL_THROW(())
Template unequality operator: compares set value of left side any to right side value.
Definition: Any.hxx:582
alloc.h
rtl::ByteSequence
C++ class representing a SAL byte sequence.
Definition: byteseq.h:161
types.h
ustring.h
sal_Bool
unsigned char sal_Bool
Definition: types.h:46
rtl
Definition: bootstrap.hxx:24
rtl::ByteSequence::getLength
sal_Int32 getLength() const SAL_THROW(())
Gets the length of sequence.
Definition: byteseq.h:236
rtl_allocateMemory
SAL_DLLPUBLIC void * rtl_allocateMemory(sal_Size Bytes) SAL_THROW_EXTERN_C()
Allocate memory.
rtl_byte_sequence_acquire
SAL_DLLPUBLIC void rtl_byte_sequence_acquire(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Acquires the byte sequence.
rtl_byte_sequence_construct
SAL_DLLPUBLIC void rtl_byte_sequence_construct(sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
Constructs a bytes sequence with length nLength.
rtl_byte_sequence_realloc
SAL_DLLPUBLIC void rtl_byte_sequence_realloc(sal_Sequence **ppSequence, sal_Int32 nSize) SAL_THROW_EXTERN_C()
Reallocates length of byte sequence.
rtl_byte_sequence_equals
SAL_DLLPUBLIC sal_Bool rtl_byte_sequence_equals(sal_Sequence *pSequence1, sal_Sequence *pSequence2) SAL_THROW_EXTERN_C()
Compares two byte sequences.
saldllapi.h
_sal_Sequence
This is the binary specification of a SAL sequence.
Definition: types.h:327
sal_Int8
signed char sal_Int8
Definition: types.h:51
rtl::BYTESEQ_NODEFAULT
This enum value can be used to create a bytesequence with uninitalized data.
Definition: byteseq.h:145
rtl_byte_sequence_getConstArray
SAL_DLLPUBLIC const sal_Int8 * rtl_byte_sequence_getConstArray(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Returns the data array pointer of the sequence.
salhelper::operator==
bool operator==(const TTimeValue &rTimeA, const TTimeValue &rTimeB)
Definition: timer.hxx:118
rtl_byte_sequence_reference2One
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.
rtl::BYTESEQ_NOACQUIRE
This enum value can be used to create a bytesequence from a C-Handle without acquiring the handle...
Definition: byteseq.h:153
rtl_byte_sequence_getLength
SAL_DLLPUBLIC sal_Int32 rtl_byte_sequence_getLength(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Returns the length of the sequence.
SAL_THROW
#define SAL_THROW(x)
Exception specification documentation.
Definition: types.h:361
SAL_DLLPUBLIC
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
rtl_byte_sequence_constructNoDefault
SAL_DLLPUBLIC void rtl_byte_sequence_constructNoDefault(sal_Sequence **ppSequence, sal_Int32 nLength) SAL_THROW_EXTERN_C()
Constructs a bytes sequence with length nLength.
rtl_byte_sequence_release
SAL_DLLPUBLIC void rtl_byte_sequence_release(sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Releases the byte sequence.
rtl::__ByteSequence_NoDefault
__ByteSequence_NoDefault
Definition: byteseq.h:141
config.h
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition: types.h:367
rtl::ByteSequence::getHandle
sal_Sequence * getHandle() const SAL_THROW(())
Returns the UNnacquired C handle of the sequence.
Definition: byteseq.h:303
SAL_WARN_UNUSED
#define SAL_WARN_UNUSED
Annotate classes where a compiler should warn if an instance is unused.
Definition: types.h:603
rtl::ByteSequence::getConstArray
const sal_Int8 * getConstArray() const SAL_THROW(())
Gets a pointer to byte array for READING.
Definition: byteseq.h:244
rtl_byte_sequence_assign
SAL_DLLPUBLIC void rtl_byte_sequence_assign(sal_Sequence **ppSequence, sal_Sequence *pSequence) SAL_THROW_EXTERN_C()
Assigns the byte sequence pSequence to *ppSequence.
rtl_freeMemory
SAL_DLLPUBLIC void rtl_freeMemory(void *Ptr) SAL_THROW_EXTERN_C()
Free memory.
rtl_byte_sequence_constructFromArray
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.