home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 3.4 KB | 119 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWBArray.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWBARRAY_H
- #define FWBARRAY_H
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- #ifndef FWEXCLIB_H
- #include "FWExcLib.h"
- #endif
-
- //========================================================================================
- // class FW_CByteArray
- //========================================================================================
-
- class FW_CByteArray : public ODByteArray
- {
- //----------------------------------------------------------------------------------------
- // Constructor(s)/Destructor
- //
- public:
- FW_DECLARE_AUTO(FW_CByteArray)
-
- FW_CByteArray();
- FW_CByteArray(void* buffer, unsigned long byteCount);
- FW_CByteArray(const void* buffer, unsigned long byteCount);
- FW_CByteArray(unsigned long byteCount);
-
- ~FW_CByteArray();
-
- //----------------------------------------------------------------------------------------
- // operator(s)
- //
- public:
- operator ODByteArray*();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void* GetBuffer() const;
- unsigned long GetBufferMaximum() const;
- unsigned long GetBufferLength() const;
-
- void Set(void* buffer, unsigned long byteCount);
-
- unsigned long CopyBuffer(void *buffer, unsigned long byteCount);
- void Clear();
-
- private:
- void PrivDisposeByteArray();
-
- //----------------------------------------------------------------------------------------
- // Non-implemented
- //
- private:
- FW_CByteArray(const FW_CByteArray& byteArray);
- FW_CByteArray& operator=(const FW_CByteArray& byteArray);
-
- //----------------------------------------------------------------------------------------
- // Data Member
- //
- private:
- FW_Boolean fOwnBuffer;
- unsigned long fOffset; // allows CopyBuffer to be used piecemeal
- };
-
- //----------------------------------------------------------------------------------------
- // operator ODByteArray*
- //----------------------------------------------------------------------------------------
- inline FW_CByteArray::operator ODByteArray*()
- {
- return this;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CByteArray::GetBuffer
- //----------------------------------------------------------------------------------------
- inline void* FW_CByteArray::GetBuffer() const
- {
- return _buffer;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CByteArray::GetBufferMaximum
- //----------------------------------------------------------------------------------------
- inline unsigned long FW_CByteArray::GetBufferMaximum() const
- {
- return _maximum;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CByteArray::GetBufferLength
- //----------------------------------------------------------------------------------------
- inline unsigned long FW_CByteArray::GetBufferLength() const
- {
- return _length;
- }
-
- //----------------------------------------------------------------------------------------
- // FW_CByteArray::Clear
- //----------------------------------------------------------------------------------------
- inline void FW_CByteArray::Clear()
- {
- PrivDisposeByteArray();
- }
-
- #endif
-
-