UDK 3.2.7 C/C++ API Reference

rtl/byteseq.h

Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*
00003  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
00018  */
00019 #ifndef _RTL_BYTESEQ_H_
00020 #define _RTL_BYTESEQ_H_
00021 
00022 #include "sal/config.h"
00023 
00024 #include "rtl/alloc.h"
00025 #include "rtl/ustring.h"
00026 #include "sal/saldllapi.h"
00027 #include "sal/types.h"
00028 
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033 
00039 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_reference2One(
00040     sal_Sequence ** ppSequence )
00041     SAL_THROW_EXTERN_C();
00042 
00048 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_realloc(
00049     sal_Sequence ** ppSequence, sal_Int32 nSize )
00050     SAL_THROW_EXTERN_C();
00051 
00056 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_acquire(
00057     sal_Sequence *pSequence )
00058     SAL_THROW_EXTERN_C();
00059 
00064 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_release(
00065     sal_Sequence *pSequence )
00066     SAL_THROW_EXTERN_C();
00067 
00074 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_construct(
00075     sal_Sequence **ppSequence , sal_Int32 nLength )
00076     SAL_THROW_EXTERN_C();
00077 
00084 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_constructNoDefault(
00085     sal_Sequence **ppSequence , sal_Int32 nLength )
00086     SAL_THROW_EXTERN_C();
00087 
00095 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_constructFromArray(
00096     sal_Sequence **ppSequence, const sal_Int8 *pData , sal_Int32 nLength )
00097     SAL_THROW_EXTERN_C();
00098 
00105 SAL_DLLPUBLIC void SAL_CALL rtl_byte_sequence_assign(
00106     sal_Sequence **ppSequence , sal_Sequence *pSequence )
00107     SAL_THROW_EXTERN_C();
00108 
00113 SAL_DLLPUBLIC sal_Bool SAL_CALL rtl_byte_sequence_equals(
00114     sal_Sequence *pSequence1 , sal_Sequence *pSequence2 )
00115     SAL_THROW_EXTERN_C();
00116 
00123 SAL_DLLPUBLIC const sal_Int8 *SAL_CALL rtl_byte_sequence_getConstArray(
00124     sal_Sequence *pSequence )
00125     SAL_THROW_EXTERN_C();
00126 
00132 SAL_DLLPUBLIC sal_Int32 SAL_CALL rtl_byte_sequence_getLength(
00133     sal_Sequence *pSequence )
00134     SAL_THROW_EXTERN_C();
00135 
00136 #ifdef __cplusplus
00137 }
00138 namespace rtl
00139 {
00140 
00141 enum __ByteSequence_NoDefault
00142 {
00145     BYTESEQ_NODEFAULT = 0xcafe
00146 };
00147 
00148 enum __ByteSequence_NoAcquire
00149 {
00153     BYTESEQ_NOACQUIRE = 0xcafebabe
00154 };
00155 
00161 class SAL_WARN_UNUSED ByteSequence
00162 {
00165     sal_Sequence * _pSequence;
00166 
00167 public:
00169     // these are here to force memory de/allocation to sal lib.
00170     inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(())
00171         { return ::rtl_allocateMemory( nSize ); }
00172     inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(())
00173         { ::rtl_freeMemory( pMem ); }
00174     inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(())
00175         { return pMem; }
00176     inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(())
00177         {}
00179 
00182     inline ByteSequence() SAL_THROW(());
00187     inline ByteSequence( const ByteSequence & rSeq ) SAL_THROW(());
00192     inline ByteSequence( sal_Sequence *pSequence ) SAL_THROW(());
00198     inline ByteSequence( const sal_Int8 * pElements, sal_Int32 len );
00203     inline ByteSequence( sal_Int32 len );
00210     inline ByteSequence( sal_Int32 len , enum __ByteSequence_NoDefault nodefault );
00220     inline ByteSequence( sal_Sequence *pSequence , enum __ByteSequence_NoAcquire noacquire ) SAL_THROW(());
00223     inline ~ByteSequence() SAL_THROW(());
00224 
00230     inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq ) SAL_THROW(());
00231 
00236     inline sal_Int32 SAL_CALL getLength() const SAL_THROW(())
00237         { return _pSequence->nElements; }
00238 
00244     inline const sal_Int8 * SAL_CALL getConstArray() const SAL_THROW(())
00245         { return (const sal_Int8 *)_pSequence->elements; }
00253     inline sal_Int8 * SAL_CALL getArray();
00254 
00267     inline sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex );
00268 
00275     inline const sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex ) const SAL_THROW(())
00276         { return getConstArray()[ nIndex ]; }
00277 
00283     inline sal_Bool SAL_CALL operator == ( const ByteSequence & rSeq ) const SAL_THROW(());
00289     inline sal_Bool SAL_CALL operator != ( const ByteSequence & rSeq ) const SAL_THROW(());
00290 
00297     inline void SAL_CALL realloc( sal_Int32 nSize );
00298 
00303     inline sal_Sequence * SAL_CALL getHandle() const SAL_THROW(())
00304         { return _pSequence; }
00309     inline sal_Sequence * SAL_CALL get() const SAL_THROW(())
00310         { return _pSequence; }
00311 };
00312 
00313 }
00314 #endif
00315 #endif
00316 
00317 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines