ParaView
vtkCommandOptionsXMLParser.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: vtkCommandOptionsXMLParser.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkCommandOptionsXMLParser_h
26 #define vtkCommandOptionsXMLParser_h
27 
28 #include "vtkCommandOptions.h" // for enum
29 #include "vtkPVCommonModule.h" // needed for export macro
30 #include "vtkXMLParser.h"
31 
32 class vtkCommandOptionsXMLParserInternal;
33 class vtkCommandOptions;
34 
35 class VTKPVCOMMON_EXPORT vtkCommandOptionsXMLParser : public vtkXMLParser
36 {
37 public:
38  static vtkCommandOptionsXMLParser* New();
39  vtkTypeMacro(vtkCommandOptionsXMLParser, vtkXMLParser);
40  void PrintSelf(ostream& os, vtkIndent indent);
41 
43 
48  void AddBooleanArgument(const char* longarg, int* var, int type = 0);
49  void AddArgument(const char* longarg, int* var, int type = 0);
50  void AddArgument(const char* longarg, char** var, int type = 0);
51  void SetPVOptions(vtkCommandOptions* o) { this->PVOptions = o; }
52 protected:
54 
58 
62  virtual ~vtkCommandOptionsXMLParser();
63 
64  // Called when a new element is opened in the XML source. Should be
65  // replaced by subclasses to handle each element.
66  // name = Name of new element.
67  // atts = Null-terminated array of attribute name/value pairs.
68  // Even indices are attribute names, and odd indices are values.
69  virtual void StartElement(const char* name, const char** atts);
70 
71  // Called at the end of an element in the XML source opened when
72  // StartElement was called.
73  virtual void EndElement(const char* name);
74  // Call to process the .. of <Option>...</>
75  void HandleOption(const char** atts);
76  // Call to process the .. of <Option>...</>
77  void HandleProcessType(const char** atts);
78 
79  virtual void SetProcessType(const char* ptype);
80  void SetProcessTypeInt(int ptype);
81 
82 private:
83  vtkCommandOptionsXMLParser(const vtkCommandOptionsXMLParser&) VTK_DELETE_FUNCTION;
84  void operator=(const vtkCommandOptionsXMLParser&) VTK_DELETE_FUNCTION;
85  int InPVXTag;
86  vtkCommandOptions* PVOptions;
87  vtkCommandOptionsXMLParserInternal* Internals;
88 };
89 
90 #endif // #ifndef vtkCommandOptionsXMLParser_h
ParaView options storage.
void SetPVOptions(vtkCommandOptions *o)
Add arguments to the xml parser.
ParaView options storage.