1 -- Created on: 1993-07-23
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1993-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 class HeaderTool from StepData
19 ---Purpose : HeaderTool exploits data from Header to build a Protocol :
20 -- it uses the Header Entity FileSchema to do this.
21 -- It builds a Protocol from the Global List of Protocols
22 -- stored in the Library ReaderLib
24 uses OStream, AsciiString from TCollection, SequenceOfAsciiString from TColStd,
25 StepReaderData, Protocol from StepData, FileProtocol
29 Create (data : StepReaderData) returns HeaderTool;
30 ---Purpose : Creates a HeaderTool from data read from a File. Computes the
31 -- list of Schema Names. The Protocol will be computed later
32 -- (because there are several options)
34 Create (names : SequenceOfAsciiString from TColStd) returns HeaderTool;
35 ---Purpose : Creates a HeaderTool directly from a list of Schema Names
37 NbSchemaNames (me) returns Integer;
38 ---Purpose : Returns the count of SchemaNames
40 SchemaName (me; num : Integer) returns AsciiString from TCollection;
41 ---Purpose : Returns a SchemaName, given its rank
42 ---C++ : return const &
44 NamedProtocol (me; name : AsciiString from TCollection)
45 returns Protocol from StepData;
46 ---Purpose : Returns the Protocol which corresponds to a Schema Name
47 -- Returns a Null Handle if this Schema Name is attached to no
48 -- Protocol recorded in the Global List of ReaderLib
50 -- Building a Protocol --
52 Build (me : in out; protocol : FileProtocol);
53 ---Purpose : Fills a FileProtocol with the list of Protocols attached to
54 -- the list of Schema Names. It can remain empty ...
56 Protocol (me : in out) returns Protocol from StepData;
57 ---Purpose : Returns a Protocol computed from the list of Schema Names :
58 -- - a Null Handle if no SchemaName has been recognized (or list
60 -- - a single Protocol if only one SchemaName has been recognized
61 -- - a FileProtocol with its componants if several SchemaNames
62 -- have been recognized
63 ---See also : method Ignored, to see if some SchemaNames were not
64 -- recognized, then they remain Ignored
66 IsDone (me) returns Boolean;
67 ---Purpose : Returns True if either Build or Protocol has been called
68 -- If it is False, Ignored and NbIgnored should not be called
70 NbIgnoreds (me) returns Integer;
71 ---Purpose : Returns the count of ignored SchemaNames (0 if all were OK)
73 Ignored (me; num : Integer) returns AsciiString from TCollection;
74 ---Purpose : Returns an ignored SchemaName, given its rank in the list of
75 -- Ignored SchemaNames (not in the total list)
76 ---C++ : return const &
78 Print (me; S : in out OStream);
79 ---Purpose : Sends the state of the HeaderTool in a comprehensive way,
80 -- to an output stream
84 thenames : SequenceOfAsciiString from TColStd;
86 theignored : SequenceOfAsciiString from TColStd;