d5c71e20 |
1 | // Copyright (c) 2021 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
14 | #ifndef _BinObjMgt_Position_HeaderFile |
15 | #define _BinObjMgt_Position_HeaderFile |
16 | |
17 | #include <Standard_Type.hxx> |
18 | |
19 | class BinObjMgt_Position; |
20 | DEFINE_STANDARD_HANDLE (BinObjMgt_Position, Standard_Transient) |
21 | |
22 | //! Stores and manipulates position in the stream. |
23 | class BinObjMgt_Position : public Standard_Transient |
24 | { |
25 | public: |
26 | |
27 | DEFINE_STANDARD_ALLOC |
28 | |
29 | //! Creates position using the current stream position. |
30 | Standard_EXPORT BinObjMgt_Position (Standard_OStream& theStream); |
31 | |
32 | //! Stores the difference between the current position and the stored one. |
33 | Standard_EXPORT void StoreSize (Standard_OStream& theStream); |
34 | //! Writes stored size at the stored position. Changes the current stream position. |
35 | //! If theDummy is true, is writes to the current position zero size. |
36 | Standard_EXPORT void WriteSize (Standard_OStream& theStream, const Standard_Boolean theDummy = Standard_False); |
37 | |
38 | DEFINE_STANDARD_RTTIEXT (BinObjMgt_Position, Standard_Transient) |
39 | |
40 | private: |
41 | std::streampos myPosition; |
42 | uint64_t mySize; |
43 | }; |
44 | |
45 | #endif // _BinObjMgt_Position_HeaderFile |