42cf5bc1 |
1 | // Created on: 1996-11-29 |
2 | // Created by: Christophe LEYNADIER |
3 | // Copyright (c) 1996-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _FSD_CmpFile_HeaderFile |
18 | #define _FSD_CmpFile_HeaderFile |
19 | |
46216226 |
20 | #include <FSD_File.hxx> |
42cf5bc1 |
21 | #include <Storage_BaseDriver.hxx> |
22 | #include <Storage_Error.hxx> |
23 | #include <Storage_OpenMode.hxx> |
24 | #include <Standard_Boolean.hxx> |
42cf5bc1 |
25 | #include <Standard_Integer.hxx> |
42cf5bc1 |
26 | #include <Standard_CString.hxx> |
42cf5bc1 |
27 | class TCollection_AsciiString; |
28 | class TCollection_ExtendedString; |
29 | class Storage_BaseDriver; |
30 | |
46216226 |
31 | class FSD_CmpFile : public FSD_File |
42cf5bc1 |
32 | { |
33 | public: |
34 | |
35 | DEFINE_STANDARD_ALLOC |
36 | |
46216226 |
37 | |
42cf5bc1 |
38 | Standard_EXPORT FSD_CmpFile(); |
46216226 |
39 | |
40 | Standard_EXPORT Storage_Error Open(const TCollection_AsciiString& aName, const Storage_OpenMode aMode); |
41 | |
42 | Standard_EXPORT static Storage_Error IsGoodFileType(const TCollection_AsciiString& aName); |
43 | |
42cf5bc1 |
44 | Standard_EXPORT Storage_Error BeginWriteInfoSection(); |
46216226 |
45 | |
42cf5bc1 |
46 | Standard_EXPORT Storage_Error BeginReadInfoSection(); |
46216226 |
47 | |
48 | Standard_EXPORT void WritePersistentObjectHeader(const Standard_Integer aRef, const Standard_Integer aType); |
49 | |
42cf5bc1 |
50 | Standard_EXPORT void BeginWritePersistentObjectData(); |
46216226 |
51 | |
42cf5bc1 |
52 | Standard_EXPORT void BeginWriteObjectData(); |
46216226 |
53 | |
42cf5bc1 |
54 | Standard_EXPORT void EndWriteObjectData(); |
46216226 |
55 | |
42cf5bc1 |
56 | Standard_EXPORT void EndWritePersistentObjectData(); |
46216226 |
57 | |
58 | Standard_EXPORT void ReadPersistentObjectHeader(Standard_Integer& aRef, Standard_Integer& aType); |
59 | |
42cf5bc1 |
60 | Standard_EXPORT void BeginReadPersistentObjectData(); |
46216226 |
61 | |
42cf5bc1 |
62 | Standard_EXPORT void BeginReadObjectData(); |
46216226 |
63 | |
42cf5bc1 |
64 | Standard_EXPORT void EndReadObjectData(); |
46216226 |
65 | |
42cf5bc1 |
66 | Standard_EXPORT void EndReadPersistentObjectData(); |
46216226 |
67 | |
42cf5bc1 |
68 | Standard_EXPORT void Destroy(); |
46216226 |
69 | ~FSD_CmpFile() |
70 | { |
71 | Destroy(); |
72 | } |
42cf5bc1 |
73 | |
4ff92abe |
74 | Standard_EXPORT static Standard_CString MagicNumber(); |
42cf5bc1 |
75 | |
76 | |
77 | |
78 | protected: |
79 | |
46216226 |
80 | |
42cf5bc1 |
81 | //! read from the current position to the end of line. |
46216226 |
82 | Standard_EXPORT void ReadLine(TCollection_AsciiString& buffer); |
83 | |
42cf5bc1 |
84 | //! read extended chars (unicode) from the current position to the end of line. |
46216226 |
85 | Standard_EXPORT void ReadExtendedLine(TCollection_ExtendedString& buffer); |
42cf5bc1 |
86 | |
46216226 |
87 | //! write from the current position to the end of line. |
88 | Standard_EXPORT void WriteExtendedLine(const TCollection_ExtendedString& buffer); |
42cf5bc1 |
89 | |
46216226 |
90 | //! read from the first none space character position to the end of line. |
91 | Standard_EXPORT void ReadString(TCollection_AsciiString& buffer); |
42cf5bc1 |
92 | |
42cf5bc1 |
93 | }; |
94 | |
42cf5bc1 |
95 | #endif // _FSD_CmpFile_HeaderFile |