42cf5bc1 |
1 | // Created on: 1992-02-03 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1992-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 _Interface_FileParameter_HeaderFile |
18 | #define _Interface_FileParameter_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <Interface_ParamType.hxx> |
25 | #include <Standard_PCharacter.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <Standard_CString.hxx> |
28 | class TCollection_AsciiString; |
29 | |
30 | |
31 | //! Auxiliary class to store a litteral parameter in a file |
32 | //! intermediate directory or in an UndefinedContent : a reference |
33 | //! type Parameter detains an Integer which is used to address a |
34 | //! record in the directory. |
35 | //! FileParameter is intended to be stored in a ParamSet : hence |
36 | //! memory management is performed by ParamSet, which calls Clear |
37 | //! to work, while the Destructor (see Destroy) does nothing. |
38 | //! Also a FileParameter can be read for consultation only, not to |
39 | //! be read from a Structure to be included into another one. |
40 | class Interface_FileParameter |
41 | { |
42 | public: |
43 | |
44 | DEFINE_STANDARD_ALLOC |
45 | |
46 | |
47 | Standard_EXPORT Interface_FileParameter(); |
48 | |
49 | //! Fills fields (with Entity Number set to zero) |
50 | Standard_EXPORT void Init (const TCollection_AsciiString& val, const Interface_ParamType typ); |
51 | |
52 | //! Same as above, but builds the Value from a CString |
53 | Standard_EXPORT void Init (const Standard_CString val, const Interface_ParamType typ); |
54 | |
55 | //! Same as above, but as a CString (for immediate exploitation) |
56 | //! was C++ : return const |
57 | Standard_EXPORT Standard_CString CValue() const; |
58 | |
59 | //! Returns the type of the parameter |
60 | Standard_EXPORT Interface_ParamType ParamType() const; |
61 | |
62 | //! Allows to set a reference to an Entity in a numbered list |
63 | Standard_EXPORT void SetEntityNumber (const Standard_Integer num); |
64 | |
65 | //! Returns value set by SetEntityNumber |
66 | Standard_EXPORT Standard_Integer EntityNumber() const; |
67 | |
68 | //! Clears stored data : frees memory taken for the String Value |
69 | Standard_EXPORT void Clear(); |
70 | |
71 | //! Destructor. Does nothing because Memory is managed by ParamSet |
72 | Standard_EXPORT void Destroy(); |
73 | ~Interface_FileParameter() |
74 | { |
75 | Destroy(); |
76 | } |
77 | |
78 | |
79 | |
80 | |
81 | protected: |
82 | |
83 | |
84 | |
85 | |
86 | |
87 | private: |
88 | |
89 | |
90 | |
91 | Interface_ParamType thetype; |
92 | Standard_PCharacter theval; |
93 | Standard_Integer thenum; |
94 | |
95 | |
96 | }; |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | |
103 | |
104 | #endif // _Interface_FileParameter_HeaderFile |