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 =========================================================================*/
29 #ifndef vtkCommandOptionsXMLParser_h
30 #define vtkCommandOptionsXMLParser_h
31 
32 #include "vtkCommandOptions.h" // for enum
33 #include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
34 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
35 #include "vtkXMLParser.h"
36 
37 class vtkCommandOptionsXMLParserInternal;
38 class vtkCommandOptions;
39 
41 {
42 public:
43  PARAVIEW_DEPRECATED_IN_5_12_0("Use `vtkCLIOptions` instead")
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
49 
54  void AddBooleanArgument(const char* longarg, int* var, int type = 0);
55  void AddArgument(const char* longarg, int* var, int type = 0);
56  void AddArgument(const char* longarg, char** var, int type = 0);
57  void SetPVOptions(vtkCommandOptions* o) { this->PVOptions = o; }
58 
59 protected:
61 
65 
69  ~vtkCommandOptionsXMLParser() override;
70 
71  // Called when a new element is opened in the XML source. Should be
72  // replaced by subclasses to handle each element.
73  // name = Name of new element.
74  // atts = Null-terminated array of attribute name/value pairs.
75  // Even indices are attribute names, and odd indices are values.
76  void StartElement(const char* name, const char** atts) override;
77 
78  // Called at the end of an element in the XML source opened when
79  // StartElement was called.
80  void EndElement(const char* name) override;
81  // Call to process the .. of <Option>...</>
82  void HandleOption(const char** atts);
83  // Call to process the .. of <Option>...</>
84  void HandleProcessType(const char** atts);
85  virtual void SetProcessType(const char* ptype);
86  void SetProcessTypeInt(int ptype);
87 
88 private:
90  void operator=(const vtkCommandOptionsXMLParser&) = delete;
91  int InPVXTag;
92  vtkCommandOptions* PVOptions;
93  vtkCommandOptionsXMLParserInternal* Internals;
94 };
95 
96 #endif // #ifndef vtkCommandOptionsXMLParser_h
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
#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.