1 /*
2 ################################################################################
3 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
4 #  Read the zproject/README.md for information about making permanent changes. #
5 ################################################################################
6 */
7 
8 #ifndef QML_ZARGS_H
9 #define QML_ZARGS_H
10 
11 #include <QtQml>
12 
13 #include <czmq.h>
14 #include "qml_czmq_plugin.h"
15 
16 
17 class QmlZargs : public QObject
18 {
19     Q_OBJECT
20     Q_PROPERTY(bool isNULL READ isNULL)
21 
22 public:
23     zargs_t *self;
24 
QmlZargs()25     QmlZargs() { self = NULL; }
isNULL()26     bool isNULL() { return self == NULL; }
27 
28     static QObject* qmlAttachedProperties(QObject* object); // defined in QmlZargs.cpp
29 
30 public slots:
31     //  Return program name (argv[0])
32     const QString progname ();
33 
34     //  Return number of positional arguments
35     size_t arguments ();
36 
37     //  Return first positional argument or NULL
38     const QString first ();
39 
40     //  Return next positional argument or NULL
41     const QString next ();
42 
43     //  Return first named parameter value, or NULL if there are no named
44     //  parameters, or value for which zargs_param_empty (arg) returns true.
45     const QString paramFirst ();
46 
47     //  Return next named parameter value, or NULL if there are no named
48     //  parameters, or value for which zargs_param_empty (arg) returns true.
49     const QString paramNext ();
50 
51     //  Return current parameter name, or NULL if there are no named
52     //  parameters.
53     const QString paramName ();
54 
55     //  Return value of named parameter, NULL if no given parameter has
56     //  been specified, or special value for wich zargs_param_empty ()
57     //  returns true.
58     const QString paramLookup (const QString &keys);
59 
60     //  Return value of named parameter(s), NULL if no given parameter has
61     //  been specified, or special value for wich zargs_param_empty ()
62     //  returns true.
63     const QString paramLookupx (const QString &keys);
64 
65     //  Returns true if there are --help -h arguments
66     bool hasHelp ();
67 
68     //  Print an instance of zargs.
69     void print ();
70 };
71 
72 class QmlZargsAttached : public QObject
73 {
74     Q_OBJECT
75     QObject* m_attached;
76 
77 public:
QmlZargsAttached(QObject * attached)78     QmlZargsAttached (QObject* attached) {
79         Q_UNUSED (attached);
80     };
81 
82 public slots:
83     //  Returns true if parameter did not have a value
84     bool paramEmpty (const QString &arg);
85 
86     //  Self test of this class.
87     void test (bool verbose);
88 
89     //  Create a new zargs from command line arguments.
90     QmlZargs *construct (int argc, QString argv);
91 
92     //  Destroy zargs instance.
93     void destruct (QmlZargs *qmlSelf);
94 };
95 
96 
97 QML_DECLARE_TYPEINFO(QmlZargs, QML_HAS_ATTACHED_PROPERTIES)
98 
99 #endif
100 /*
101 ################################################################################
102 #  THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY  #
103 #  Read the zproject/README.md for information about making permanent changes. #
104 ################################################################################
105 */
106