enum __ByteSequence_NoDefault
{ /** This enum value can be used to create a bytesequence with uninitialized data
*/
BYTESEQ_NODEFAULT = 0xcafe
};
enum __ByteSequence_NoAcquire
{ /** This enum value can be used to create a bytesequence from a C-Handle without acquiringthehandle.
*/
BYTESEQ_NOACQUIRE = #ifdefined _MSC_VER int(0xcafebabe) #else 0xcafebabe #endif
};
/** C++ class representing a SAL byte sequence. C++Sequencesarereferencecountedandshared,sothesequencekeepsahandletoitsdata. Tokeepvaluesemantics,copiesareonlygeneratedifthesequenceistobemodified (newhandle).
*/ class SAL_WARN_UNUSED ByteSequence
{ /** sequence handle
*/
sal_Sequence * _pSequence;
public: /// @cond INTERNAL // these are here to force memory de/allocation to sal lib. staticvoid * SAL_CALL operatornew ( size_t nSize )
{ return ::rtl_allocateMemory( nSize ); } staticvoid SAL_CALL operatordelete ( void * pMem )
{ ::rtl_freeMemory( pMem ); } staticvoid * SAL_CALL operatornew ( size_t, void * pMem )
{ return pMem; } staticvoid SAL_CALL operatordelete ( void *, void * )
{} /// @endcond
/** Default constructor: Creates an empty sequence.
*/ inline ByteSequence(); /** Copy constructor: Creates a copy of given sequence.
@paramrSeqanotherbytesequence
*/ inline ByteSequence( const ByteSequence & rSeq ); #ifdefined LIBO_INTERNAL_ONLY inline ByteSequence( ByteSequence && rSeq ) noexcept; #endif /** Copy constructor Creates a copy from the C-Handle.
@parampSequenceanotherbytesequencehandle
*/ inline ByteSequence( sal_Sequence *pSequence ); /** Constructor: Creates a copy of given data bytes.
@parampElementsanarrayofbytes @paramlennumberofbytes
*/ inline ByteSequence( const sal_Int8 * pElements, sal_Int32 len ); /** Constructor: Creates sequence of given length and initializes all bytes to 0.
@paramleninitialsequencelength
*/ inline ByteSequence( sal_Int32 len ); /** Constructor: Creates sequence of given length and does NOT initialize data. Usethisctorforperformanceoptimizationonly.
/** Gets a pointer to byte array for READING. If the sequence has a length of 0, then the returnedpointerisundefined.
@returnpointertobytearray
*/ const sal_Int8 * SAL_CALL getConstArray() const
{ returnreinterpret_cast<sal_Int8 *>(_pSequence->elements); } /** Gets a pointer to elements array for READING AND WRITING. In general if the sequence hasahandleacquiredbyothersequences(referencecount>1),thenanewsequenceis createdcopyingallbytestokeepvaluesemantics! Ifthesequencehasalengthof0,thenthereturnedpointerisundefined.
/** Reallocates sequence to new length. If the sequence has a handle acquired by other sequences (referencecount>1),thentheremainingelementsarecopiedtoanewsequencehandleto keepvaluesemantics!
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.