0028039: Coding rules, TObj - pass file name by reference
[occt.git] / src / Dico / Dico_IteratorOfDictionaryOfInteger.hxx
1 // Created on: 1992-07-28
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 _Dico_IteratorOfDictionaryOfInteger_HeaderFile
18 #define _Dico_IteratorOfDictionaryOfInteger_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <TCollection_AsciiString.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_CString.hxx>
28 class Dico_DictionaryOfInteger;
29 class Dico_StackItemOfDictionaryOfInteger;
30 class Standard_NoSuchObject;
31 class TCollection_AsciiString;
32
33
34
35 class Dico_IteratorOfDictionaryOfInteger 
36 {
37 public:
38
39   DEFINE_STANDARD_ALLOC
40
41   
42   //! Creates an iterator which will work on all the dictionary
43   Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell);
44   
45   //! Creates an iterator which will consider only entries
46   //! which name begin by the string given as basename (subpart)
47   Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell, const Standard_CString basename);
48   
49   //! Creates an iterator which will consider only entries
50   //! which name begin by the string given as basename (subpart)
51   //! Same as above, but basename is String instead of CString
52   Standard_EXPORT Dico_IteratorOfDictionaryOfInteger(const Handle(Dico_DictionaryOfInteger)& acell, const TCollection_AsciiString& basename);
53   
54   //! Allows to Start a new Iteration from beginning
55   Standard_EXPORT void Start();
56   
57   //! Returns True if there are more entries to return
58   Standard_EXPORT Standard_Boolean More();
59   
60   //! Go to the next entry
61   //! (if there is not, Value will raise an exception)
62   Standard_EXPORT void Next();
63   
64   //! Returns item value of current entry
65   Standard_EXPORT const Standard_Integer& Value() const;
66   
67   //! Returns name of current entry
68   Standard_EXPORT TCollection_AsciiString Name() const;
69
70
71
72
73 protected:
74
75
76
77
78
79 private:
80
81   
82   //! Appends a new value to the Iteration Stack
83   Standard_EXPORT void AppendStack (const Handle(Dico_DictionaryOfInteger)& val);
84
85
86   Handle(Dico_DictionaryOfInteger) thebase;
87   TCollection_AsciiString thename;
88   Handle(Dico_StackItemOfDictionaryOfInteger) thelast;
89   Standard_Integer thenb;
90   Standard_Boolean themore;
91   Standard_Boolean theinit;
92   Standard_Boolean thenext;
93
94
95 };
96
97
98
99
100
101
102
103 #endif // _Dico_IteratorOfDictionaryOfInteger_HeaderFile