0026229: Add the possibility in OCAF to open/save a document from/to a stream object
[occt.git] / src / Storage / Storage_TypeData.hxx
1 // Created on: 1997-02-06
2 // Created by: Kernel
3 // Copyright (c) 1997-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 _Storage_TypeData_HeaderFile
18 #define _Storage_TypeData_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Storage_PType.hxx>
24 #include <Storage_Error.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <MMgt_TShared.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Standard_Boolean.hxx>
29 #include <TColStd_HSequenceOfAsciiString.hxx>
30 class Standard_NoSuchObject;
31 class Storage_Schema;
32 class TCollection_AsciiString;
33
34
35 class Storage_TypeData;
36 DEFINE_STANDARD_HANDLE(Storage_TypeData, MMgt_TShared)
37
38
39 class Storage_TypeData : public MMgt_TShared
40 {
41
42 public:
43
44   
45   Standard_EXPORT Storage_TypeData();
46   
47   Standard_EXPORT Standard_Integer NumberOfTypes() const;
48   
49   Standard_EXPORT Standard_Boolean IsType (const TCollection_AsciiString& aName) const;
50   
51   Standard_EXPORT Handle(TColStd_HSequenceOfAsciiString) Types() const;
52   
53   Standard_EXPORT Storage_Error ErrorStatus() const;
54   
55   Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
56   
57   Standard_EXPORT void ClearErrorStatus();
58   
59   Standard_EXPORT void Clear();
60
61   //! add a type to the list
62   Standard_EXPORT void AddType (const TCollection_AsciiString& aName, const Standard_Integer aTypeNum);
63
64   //! returns the name of the type with number <aTypeNum>
65   Standard_EXPORT TCollection_AsciiString Type (const Standard_Integer aTypeNum) const;
66
67   //! returns the name of the type with number <aTypeNum>
68   Standard_EXPORT Standard_Integer Type (const TCollection_AsciiString& aTypeName) const;
69
70
71 friend class Storage_Schema;
72
73
74   DEFINE_STANDARD_RTTIEXT(Storage_TypeData,MMgt_TShared)
75
76 protected:
77
78
79
80
81 private:
82
83   
84   Standard_EXPORT void SetErrorStatus (const Storage_Error anError);
85   
86   Standard_EXPORT void SetErrorStatusExtension (const TCollection_AsciiString& anErrorExt);
87
88   Storage_PType myPt;
89   Storage_Error myErrorStatus;
90   TCollection_AsciiString myErrorStatusExt;
91
92
93 };
94
95
96
97
98
99
100
101 #endif // _Storage_TypeData_HeaderFile