0031353: TDocStd_Application does not have api to set progress indicator
[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>
28
42cf5bc1 29class TCollection_AsciiString;
30
31
32//! More or less independent part of the saved/restored document
33//! that is distinct from OCAF data themselves but may be referred
34//! by them.
35class BinLDrivers_DocumentSection
36{
37public:
38
39 DEFINE_STANDARD_ALLOC
40
41
42 //! Empty constructor
43 Standard_EXPORT BinLDrivers_DocumentSection();
44
45 //! Constructor
46 Standard_EXPORT BinLDrivers_DocumentSection(const TCollection_AsciiString& theName, const Standard_Boolean isPostRead);
47
48 //! Query the name of the section.
49 Standard_EXPORT const TCollection_AsciiString& Name() const;
50
51 //! Query the status: if the Section should be read after OCAF;
52 //! False means that the Section is read before starting to
53 //! read OCAF data.
54 Standard_EXPORT Standard_Boolean IsPostRead() const;
55
56 //! Query the offset of the section in the persistent file
41fbbba8 57 Standard_EXPORT uint64_t Offset() const;
42cf5bc1 58
59 //! Set the offset of the section in the persistent file
41fbbba8 60 Standard_EXPORT void SetOffset (const uint64_t theOffset);
42cf5bc1 61
62 //! Query the length of the section in the persistent file
41fbbba8 63 Standard_EXPORT uint64_t Length() const;
42cf5bc1 64
65 //! Set the length of the section in the persistent file
41fbbba8 66 Standard_EXPORT void SetLength (const uint64_t theLength);
42cf5bc1 67
68 //! Create a Section entry in the Document TOC (list of sections)
69 Standard_EXPORT void WriteTOC (Standard_OStream& theOS);
70
71 //! Save Offset and Length data into the Section entry
72 //! in the Document TOC (list of sections)
41fbbba8 73 Standard_EXPORT void Write (Standard_OStream& theOS, const uint64_t theOffset);
42cf5bc1 74
75 //! Fill a DocumentSection instance from the data that are read
76 //! from TOC.
b34d86cb 77 Standard_EXPORT static void ReadTOC (BinLDrivers_DocumentSection& theSection, Standard_IStream& theIS,
78 const Standard_Integer theDocFormatVersion);
42cf5bc1 79
80
81
82
83protected:
84
85
86
87
88
89private:
90
91
92
93 TCollection_AsciiString myName;
41fbbba8 94 uint64_t myValue[2];
42cf5bc1 95 Standard_Boolean myIsPostRead;
96
97
98};
99
100
101
102
103
104
105
106#endif // _BinLDrivers_DocumentSection_HeaderFile