vtkCommandOptionsXMLParser.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkCommandOptionsXMLParser_h
18 #define vtkCommandOptionsXMLParser_h
19 
20 #include "vtkCommandOptions.h" // for enum
21 #include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
22 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
23 #include "vtkXMLParser.h"
24 
25 class vtkCommandOptionsXMLParserInternal;
26 class vtkCommandOptions;
27 
29 {
30 public:
31  PARAVIEW_DEPRECATED_IN_5_12_0("Use `vtkCLIOptions` instead")
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
37 
42  void AddBooleanArgument(const char* longarg, int* var, int type = 0);
43  void AddArgument(const char* longarg, int* var, int type = 0);
44  void AddArgument(const char* longarg, char** var, int type = 0);
45  void SetPVOptions(vtkCommandOptions* o) { this->PVOptions = o; }
46 
47 protected:
49 
53 
57  ~vtkCommandOptionsXMLParser() override;
58 
59  // Called when a new element is opened in the XML source. Should be
60  // replaced by subclasses to handle each element.
61  // name = Name of new element.
62  // atts = Null-terminated array of attribute name/value pairs.
63  // Even indices are attribute names, and odd indices are values.
64  void StartElement(const char* name, const char** atts) override;
65 
66  // Called at the end of an element in the XML source opened when
67  // StartElement was called.
68  void EndElement(const char* name) override;
69  // Call to process the .. of <Option>...</>
70  void HandleOption(const char** atts);
71  // Call to process the .. of <Option>...</>
72  void HandleProcessType(const char** atts);
73  virtual void SetProcessType(const char* ptype);
74  void SetProcessTypeInt(int ptype);
75 
76 private:
78  void operator=(const vtkCommandOptionsXMLParser&) = delete;
79  int InPVXTag;
80  vtkCommandOptions* PVOptions;
81  vtkCommandOptionsXMLParserInternal* Internals;
82 };
83 
84 #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.