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_ZDIGEST_H 9 #define QML_ZDIGEST_H 10 11 #include <QtQml> 12 13 #include <czmq.h> 14 #include "qml_czmq_plugin.h" 15 16 17 class QmlZdigest : public QObject 18 { 19 Q_OBJECT 20 Q_PROPERTY(bool isNULL READ isNULL) 21 22 public: 23 zdigest_t *self; 24 QmlZdigest()25 QmlZdigest() { self = NULL; } isNULL()26 bool isNULL() { return self == NULL; } 27 28 static QObject* qmlAttachedProperties(QObject* object); // defined in QmlZdigest.cpp 29 30 public slots: 31 // Add buffer into digest calculation 32 void update (const byte *buffer, size_t length); 33 34 // Return final digest hash data. If built without crypto support, 35 // returns NULL. 36 const byte *data (); 37 38 // Return final digest hash size 39 size_t size (); 40 41 // Return digest as printable hex string; caller should not modify nor 42 // free this string. After calling this, you may not use zdigest_update() 43 // on the same digest. If built without crypto support, returns NULL. 44 const QString string (); 45 }; 46 47 class QmlZdigestAttached : public QObject 48 { 49 Q_OBJECT 50 QObject* m_attached; 51 52 public: QmlZdigestAttached(QObject * attached)53 QmlZdigestAttached (QObject* attached) { 54 Q_UNUSED (attached); 55 }; 56 57 public slots: 58 // Self test of this class. 59 void test (bool verbose); 60 61 // Constructor - creates new digest object, which you use to build up a 62 // digest by repeatedly calling zdigest_update() on chunks of data. 63 QmlZdigest *construct (); 64 65 // Destroy a digest object 66 void destruct (QmlZdigest *qmlSelf); 67 }; 68 69 70 QML_DECLARE_TYPEINFO(QmlZdigest, QML_HAS_ATTACHED_PROPERTIES) 71 72 #endif 73 /* 74 ################################################################################ 75 # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # 76 # Read the zproject/README.md for information about making permanent changes. # 77 ################################################################################ 78 */ 79