LibreOffice
LibreOffice 5.0 SDK C/C++ API Reference
 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 
40  sal_Sequence ** ppSequence )
42 
49  sal_Sequence ** ppSequence, sal_Int32 nSize )
51 
57  sal_Sequence *pSequence )
59 
65  sal_Sequence *pSequence )
67 
75  sal_Sequence **ppSequence , sal_Int32 nLength )
77 
85  sal_Sequence **ppSequence , sal_Int32 nLength )
87 
96  sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength )
98 
106  sal_Sequence **ppSequence , sal_Sequence *pSequence )
108 
114  sal_Sequence *pSequence1 , sal_Sequence *pSequence2 )
116 
124  sal_Sequence *pSequence )
126 
132 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_byte_sequence_getLength(
133  sal_Sequence *pSequence )
135 
136 #ifdef __cplusplus
137 }
138 namespace rtl
139 {
140 
142 {
146 };
147 
149 {
153  BYTESEQ_NOACQUIRE = 0xcafebabe
154 };
155 
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 )
171  { return ::rtl_allocateMemory( nSize ); }
172  inline static void SAL_CALL operator delete ( void * pMem )
173  { ::rtl_freeMemory( pMem ); }
174  inline static void * SAL_CALL operator new ( size_t, void * pMem )
175  { return pMem; }
176  inline static void SAL_CALL operator delete ( void *, void * )
177  {}
179 
182  inline ByteSequence();
187  inline ByteSequence( const ByteSequence & rSeq );
192  inline ByteSequence( sal_Sequence *pSequence );
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 );
223  inline ~ByteSequence();
224 
230  inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq );
231 
236  inline sal_Int32 SAL_CALL getLength() const
237  { return _pSequence->nElements; }
238 
244  inline const sal_Int8 * SAL_CALL getConstArray() const
245  { return reinterpret_cast<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
276  { return getConstArray()[ nIndex ]; }
277 
283  inline bool SAL_CALL operator == ( const ByteSequence & rSeq ) const;
289  inline bool SAL_CALL operator != ( const ByteSequence & rSeq ) const;
290 
297  inline void SAL_CALL realloc( sal_Int32 nSize );
298 
303  inline sal_Sequence * SAL_CALL getHandle() const
304  { return _pSequence; }
309  inline sal_Sequence * SAL_CALL get() const
310  { return _pSequence; }
311 };
312 
313 }
314 #endif
315 #endif
316 
317 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */