ctkCmdLineModuleObjectHierarchyReader.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*=============================================================================
  2. Library: CTK
  3. Copyright (c) German Cancer Research Center,
  4. Division of Medical and Biological Informatics
  5. Licensed under the Apache License, Version 2.0 (the "License");
  6. you may not use this file except in compliance with the License.
  7. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. =============================================================================*/
  15. #ifndef CTKCMDLINEMODULEOBJECTHIERARCHYREADER_H
  16. #define CTKCMDLINEMODULEOBJECTHIERARCHYREADER_H
  17. #include <QString>
  18. #include <QScopedPointer>
  19. #include <QVariant>
  20. #include <ctkCommandLineModulesCoreExport.h>
  21. class QObject;
  22. class ctkCmdLineModuleObjectHierarchyReaderPrivate;
  23. class CTK_CMDLINEMODULECORE_EXPORT ctkCmdLineModuleObjectHierarchyReader
  24. {
  25. public:
  26. enum TokenType {
  27. NoToken,
  28. Executable,
  29. ParameterGroup,
  30. Parameter
  31. };
  32. ctkCmdLineModuleObjectHierarchyReader(QObject* root = 0);
  33. ~ctkCmdLineModuleObjectHierarchyReader();
  34. void setRootObject(QObject* root);
  35. void clear();
  36. bool atEnd() const;
  37. bool isParameterGroup() const;
  38. bool isParameter() const;
  39. QString name() const;
  40. QString label() const;
  41. QVariant value() const;
  42. void setValue(const QVariant& value);
  43. QString flag() const;
  44. QString longFlag() const;
  45. int index() const;
  46. bool isMultiple() const;
  47. QVariant property(const QString& propName) const;
  48. TokenType readNext() const;
  49. bool readNextExecutable() const;
  50. bool readNextParameterGroup() const;
  51. bool readNextParameter() const;
  52. TokenType tokenType() const;
  53. private:
  54. QScopedPointer<ctkCmdLineModuleObjectHierarchyReaderPrivate> d;
  55. };
  56. #endif // CTKCMDLINEMODULEOBJECTHIERARCHYREADER_H