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
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Interface_FileParameter_HeaderFile
18 #define _Interface_FileParameter_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Interface_ParamType.hxx>
25 #include <Standard_PCharacter.hxx>
26 #include <Standard_Integer.hxx>
27 #include <Standard_CString.hxx>
28 class TCollection_AsciiString;
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
47 Standard_EXPORT Interface_FileParameter();
49 //! Fills fields (with Entity Number set to zero)
50 Standard_EXPORT void Init (const TCollection_AsciiString& val, const Interface_ParamType typ);
52 //! Same as above, but builds the Value from a CString
53 Standard_EXPORT void Init (const Standard_CString val, const Interface_ParamType typ);
55 //! Same as above, but as a CString (for immediate exploitation)
56 //! was C++ : return const
57 Standard_EXPORT Standard_CString CValue() const;
59 //! Returns the type of the parameter
60 Standard_EXPORT Interface_ParamType ParamType() const;
62 //! Allows to set a reference to an Entity in a numbered list
63 Standard_EXPORT void SetEntityNumber (const Standard_Integer num);
65 //! Returns value set by SetEntityNumber
66 Standard_EXPORT Standard_Integer EntityNumber() const;
68 //! Clears stored data : frees memory taken for the String Value
69 Standard_EXPORT void Clear();
71 //! Destructor. Does nothing because Memory is managed by ParamSet
72 Standard_EXPORT void Destroy();
73 ~Interface_FileParameter()
91 Interface_ParamType thetype;
92 Standard_PCharacter theval;
93 Standard_Integer thenum;
104 #endif // _Interface_FileParameter_HeaderFile