0032402: Coding Rules - eliminate msvc warning C4668 (symbol is not defined as a...
[occt.git] / src / BinLDrivers / BinLDrivers_DocumentSection.hxx
CommitLineData
42cf5bc1 1// Created by: Alexander GRIGORIEV
2// Copyright (c) 2007-2014 OPEN CASCADE SAS
3//
4// This file is part of Open CASCADE Technology software library.
5//
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.
11//
12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
14
15#ifndef _BinLDrivers_DocumentSection_HeaderFile
16#define _BinLDrivers_DocumentSection_HeaderFile
17
18#include <Standard.hxx>
19#include <Standard_DefineAlloc.hxx>
20#include <Standard_Handle.hxx>
21
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>
6d8f9f4a 27#include <Message_ProgressIndicator.hxx>
9f45d35b 28#include <TDocStd_FormatVersion.hxx>
6d8f9f4a 29
42cf5bc1 30class TCollection_AsciiString;
31
32
33//! More or less independent part of the saved/restored document
34//! that is distinct from OCAF data themselves but may be referred
35//! by them.
36class BinLDrivers_DocumentSection
37{
38public:
39
40 DEFINE_STANDARD_ALLOC
41
42
43 //! Empty constructor
44 Standard_EXPORT BinLDrivers_DocumentSection();
45
46 //! Constructor
47 Standard_EXPORT BinLDrivers_DocumentSection(const TCollection_AsciiString& theName, const Standard_Boolean isPostRead);
48
49 //! Query the name of the section.
50 Standard_EXPORT const TCollection_AsciiString& Name() const;
51
52 //! Query the status: if the Section should be read after OCAF;
53 //! False means that the Section is read before starting to
54 //! read OCAF data.
55 Standard_EXPORT Standard_Boolean IsPostRead() const;
56
57 //! Query the offset of the section in the persistent file
41fbbba8 58 Standard_EXPORT uint64_t Offset() const;
42cf5bc1 59
60 //! Set the offset of the section in the persistent file
41fbbba8 61 Standard_EXPORT void SetOffset (const uint64_t theOffset);
42cf5bc1 62
63 //! Query the length of the section in the persistent file
41fbbba8 64 Standard_EXPORT uint64_t Length() const;
42cf5bc1 65
66 //! Set the length of the section in the persistent file
41fbbba8 67 Standard_EXPORT void SetLength (const uint64_t theLength);
42cf5bc1 68
69 //! Create a Section entry in the Document TOC (list of sections)
716cf4d9 70 Standard_EXPORT void WriteTOC (Standard_OStream& theOS,
9f45d35b 71 const TDocStd_FormatVersion theDocFormatVersion);
42cf5bc1 72
73 //! Save Offset and Length data into the Section entry
74 //! in the Document TOC (list of sections)
716cf4d9 75 Standard_EXPORT void Write (Standard_OStream& theOS, const uint64_t theOffset,
9f45d35b 76 const TDocStd_FormatVersion theDocFormatVersion);
42cf5bc1 77
78 //! Fill a DocumentSection instance from the data that are read
79 //! from TOC.
b34d86cb 80 Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS,
9f45d35b 81 const TDocStd_FormatVersion theDocFormatVersion);
42cf5bc1 82
83
84
85
86protected:
87
88
89
90
91
92private:
93
94
95
96 TCollection_AsciiString myName;
41fbbba8 97 uint64_t myValue[2];
42cf5bc1 98 Standard_Boolean myIsPostRead;
99
100
101};
102
103
104
105
106
107
108
109#endif // _BinLDrivers_DocumentSection_HeaderFile