1 // Created by: Alexander GRIGORIEV
2 // Copyright (c) 2007-2014 OPEN CASCADE SAS
4 // This file is part of Open CASCADE Technology software library.
6 // This library is free software; you can redistribute it and/or modify it under
7 // the terms of the GNU Lesser General Public License version 2.1 as published
8 // by the Free Software Foundation, with special exception defined in the file
9 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10 // distribution for complete text of the license and disclaimer of any warranty.
12 // Alternatively, this file may be used under the terms of Open CASCADE
13 // commercial license or contractual agreement.
15 #ifndef _BinLDrivers_DocumentSection_HeaderFile
16 #define _BinLDrivers_DocumentSection_HeaderFile
18 #include <Standard.hxx>
19 #include <Standard_DefineAlloc.hxx>
20 #include <Standard_Handle.hxx>
22 #include <TCollection_AsciiString.hxx>
23 #include <Standard_Size.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_OStream.hxx>
26 #include <Standard_IStream.hxx>
27 class TCollection_AsciiString;
30 //! More or less independent part of the saved/restored document
31 //! that is distinct from OCAF data themselves but may be referred
33 class BinLDrivers_DocumentSection
41 Standard_EXPORT BinLDrivers_DocumentSection();
44 Standard_EXPORT BinLDrivers_DocumentSection(const TCollection_AsciiString& theName, const Standard_Boolean isPostRead);
46 //! Query the name of the section.
47 Standard_EXPORT const TCollection_AsciiString& Name() const;
49 //! Query the status: if the Section should be read after OCAF;
50 //! False means that the Section is read before starting to
52 Standard_EXPORT Standard_Boolean IsPostRead() const;
54 //! Query the offset of the section in the persistent file
55 Standard_EXPORT Standard_Size Offset() const;
57 //! Set the offset of the section in the persistent file
58 Standard_EXPORT void SetOffset (const Standard_Size theOffset);
60 //! Query the length of the section in the persistent file
61 Standard_EXPORT Standard_Size Length() const;
63 //! Set the length of the section in the persistent file
64 Standard_EXPORT void SetLength (const Standard_Size theLength);
66 //! Create a Section entry in the Document TOC (list of sections)
67 Standard_EXPORT void WriteTOC (Standard_OStream& theOS);
69 //! Save Offset and Length data into the Section entry
70 //! in the Document TOC (list of sections)
71 Standard_EXPORT void Write (Standard_OStream& theOS, const Standard_Size theOffset);
73 //! Fill a DocumentSection instance from the data that are read
75 Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS);
90 TCollection_AsciiString myName;
91 Standard_Size myValue[2];
92 Standard_Boolean myIsPostRead;
103 #endif // _BinLDrivers_DocumentSection_HeaderFile