0024059: Eliminate compiler warning C4701 in MSVC++ with warning level 4
[occt.git] / src / DDF / DDF_AttributeBrowser.cxx
1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 //              ------------------------
21
22 // Version:     0.0
23 //Version       Date            Purpose
24 //              0.0     Oct  6 1997     Creation
25
26
27
28 #include <DDF_AttributeBrowser.hxx>
29
30 static DDF_AttributeBrowser* DDF_FirstBrowser = NULL;
31
32 //=======================================================================
33 //function : DDF_AttributeBrowser
34 //purpose  : 
35 //=======================================================================
36
37 DDF_AttributeBrowser::DDF_AttributeBrowser
38 (Standard_Boolean (*test)(const Handle(TDF_Attribute)&),
39  TCollection_AsciiString (*open)(const Handle(TDF_Attribute)&),
40  TCollection_AsciiString (*text)(const Handle(TDF_Attribute)&))
41 : myTest(test),
42   myOpen(open), 
43   myText(text),
44   myNext(DDF_FirstBrowser)
45 {
46   DDF_FirstBrowser = this;
47 }
48
49
50 //=======================================================================
51 //function : Test
52 //purpose  : 
53 //=======================================================================
54
55 Standard_Boolean DDF_AttributeBrowser::Test
56 (const Handle(TDF_Attribute)&anAtt) const
57 {return (*myTest) (anAtt);}
58
59
60 //=======================================================================
61 //function : Open
62 //purpose  : 
63 //=======================================================================
64
65 TCollection_AsciiString DDF_AttributeBrowser::Open
66 (const Handle(TDF_Attribute)& anAtt) const
67 { return (*myOpen) (anAtt);}
68
69
70 //=======================================================================
71 //function : Text
72 //purpose  : 
73 //=======================================================================
74
75 TCollection_AsciiString DDF_AttributeBrowser::Text
76 (const Handle(TDF_Attribute)& anAtt) const
77 {return (*myText) (anAtt);}
78
79
80 //=======================================================================
81 //function : FindBrowser
82 //purpose  : 
83 //=======================================================================
84
85 DDF_AttributeBrowser* DDF_AttributeBrowser::FindBrowser
86 (const Handle(TDF_Attribute)&anAtt)
87 {
88   DDF_AttributeBrowser* browser = DDF_FirstBrowser;
89   while (browser) {
90     if (browser->Test(anAtt)) break;
91     browser = browser->Next();
92   }
93   return browser;
94 }