/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _PRCRWFILERBASE_INCLUDED_ #define _PRCRWFILERBASE_INCLUDED_ class OdPrcUncompressedFiler; #include "PrcToolkitExportDef.h" #include "PrcFiler.h" #include "OdStreamBuf.h" #include "FlatMemStream.h" #include "UInt8Array.h" #include "PrcGraphics.h" SMARTPTR(OdPrcUncompressedFiler); struct OdPrcSectionExtractor; class OdPrcLowLevelDumper; class OdPrcAuditInfo; /** \details Class provides methods for working with uncompressed .prc files. */ class PRC_TOOLKIT OdPrcUncompressedFiler : public OdPrcFiler { friend struct OdPrcSectionExtractor; friend class OdPrcLowLevelDumper; OdStreamBufPtr m_pBuf; protected: OdPrcUncompressedFiler(OdStreamBufPtr pBuf, OdUInt32 authoring_version); public: //DOM-IGNORE-BEGIN ODPRCRX_DECLARE(OdPrcUncompressedFiler) //DOM-IGNORE-END /** \details Requests the pointer to the internal data buffer. \returns A pointer to the OdStreamBuf object that represents the internal data buffer. */ virtual OdStreamBuf* internalBuffer(); /** \details Destroys the uncompressed filer object. */ virtual ~OdPrcUncompressedFiler(); /** \details Requests the current position in the data file associated with the internal data buffer. \returns The 64-bit unsigned integer value that contains the current position of the file pointer in the internal data buffer. */ virtual OdUInt64 tell(); /** \details Requests the length (in bytes) of the data file associated with the filer object. \returns The 64-bit unsigned integer value that contains the length (in bytes) of the file associated with the filer object. */ virtual OdUInt64 length(); /** \details Moves the current position of the file pointer in the associated data file to the specified location. \param offset [in] A number of bytes to move the file position pointer. \param seekType [in] A seek type. \returns A signed 64-bit integer value that represents the current position in the associated data file. \remarks The seek type value must be one of the following:
OdDb Namespace ValueMnemonic ValueDescription
OdDb::kSeekFromStart SEEK_SETStart of file
OdDb::kSeekFromCurrent SEEK_CURCurrent position of file pointer.
OdDb::kSeekFromEnd SEEK_ENDEnd of file
*/ virtual OdUInt64 seek(OdInt64 offset, OdDb::FilerSeekType seekType); /** \details Creates a new uncompressed filer object, fills its fields, and returns a smart pointer to it. \param pBuf [in] A data input stream. \param authoring_version [in] An authoring version. \param pAuditInfo [out] A pointer to the placeholder of the audit information associated with the object. \returns A smart pointer to the newly created object. */ static OdPrcUncompressedFilerPtr create(OdStreamBufPtr pBuf, OdUInt32 authoring_version, OdPrcAuditInfo *pAuditInfo); /** \details Writes an unsigned integer to the data file associated with the filer object. \param i [in] An integer value to write. \param pName [in] A name of the appropriate field where the specified value should be written. */ virtual void writeUncompressedUnsignedInteger(OdUInt32 i, const char* pName = 0); /** \details Requests the current value of a specified field. \param pName [in] An input name of the field. \returns An unsigned 32-bit integer value of the specified field. */ virtual OdUInt32 readUncompressedUnsignedInteger(const char* pName = 0); /** \details Reads a block of data with a specified size (in bytes) from the file associated with the filer object. \param pBuf [out] A pointer to a buffer that contains read bytes. \param size [in] A 32-bit unsigned integer value that contains the block size (in bytes). */ virtual void readUncompressedBlock(OdUInt8 *pBuf, OdUInt32 size); /** \details Writes a block of data with a specified size (in bytes) to the file associated with the filer object. \param pBuf [in] A constant pointer to the beginning (to the first byte) of the data block to write. \param size [in] A 32-bit unsigned integer value that contains the block size (in bytes). */ virtual void writeUncompressedBlock(const OdUInt8 *pBuf, OdUInt32 size); }; #endif //_PRCRWFILERBASE_INCLUDED_