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 "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
30 #include "vtkXMLParser.h"
31 
32 class vtkCommandOptionsXMLParserInternal;
33 class vtkCommandOptions;
34 
36 {
37 public:
40  void PrintSelf(ostream& os, vtkIndent indent) override;
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  ~vtkCommandOptionsXMLParser() override;
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  void StartElement(const char* name, const char** atts) override;
70 
71  // Called at the end of an element in the XML source opened when
72  // StartElement was called.
73  void EndElement(const char* name) override;
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:
84  void operator=(const vtkCommandOptionsXMLParser&) = delete;
85  int InPVXTag;
86  vtkCommandOptions* PVOptions;
87  vtkCommandOptionsXMLParserInternal* Internals;
88 };
89 
90 #endif // #ifndef vtkCommandOptionsXMLParser_h
#define VTKPVVTKEXTENSIONSCORE_EXPORT
virtual void StartElement(const char *name, const char **atts)
name
ParaView options storage.
void PrintSelf(ostream &os, vtkIndent indent)
virtual void EndElement(const char *name)
void SetPVOptions(vtkCommandOptions *o)
Add arguments to the xml parser.
static vtkXMLParser * New()
void operator=(const vtkObjectBase &)
ParaView options storage.