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 #include "qczmq.h"
9
10 ///
11 // Copy-construct to return the proper wrapped c types
QZarmour(zarmour_t * self,QObject * qObjParent)12 QZarmour::QZarmour (zarmour_t *self, QObject *qObjParent) : QObject (qObjParent)
13 {
14 this->self = self;
15 }
16
17
18 ///
19 // Create a new zarmour
QZarmour(QObject * qObjParent)20 QZarmour::QZarmour (QObject *qObjParent) : QObject (qObjParent)
21 {
22 this->self = zarmour_new ();
23 }
24
25 ///
26 // Destroy the zarmour
~QZarmour()27 QZarmour::~QZarmour ()
28 {
29 zarmour_destroy (&self);
30 }
31
32 ///
33 // Encode a stream of bytes into an armoured string. Returns the armoured
34 // string, or NULL if there was insufficient memory available to allocate
35 // a new string.
encode(const byte * data,size_t size)36 QString QZarmour::encode (const byte *data, size_t size)
37 {
38 char *retStr_ = zarmour_encode (self, data, size);
39 QString rv = QString (retStr_);
40 zstr_free (&retStr_);
41 return rv;
42 }
43
44 ///
45 // Decode an armoured string into a chunk. The decoded output is
46 // null-terminated, so it may be treated as a string, if that's what
47 // it was prior to encoding.
decode(const QString & data)48 QZchunk * QZarmour::decode (const QString &data)
49 {
50 QZchunk *rv = new QZchunk (zarmour_decode (self, data.toUtf8().data()));
51 return rv;
52 }
53
54 ///
55 // Get the mode property.
mode()56 int QZarmour::mode ()
57 {
58 int rv = zarmour_mode (self);
59 return rv;
60 }
61
62 ///
63 // Get printable string for mode.
modeStr()64 const QString QZarmour::modeStr ()
65 {
66 const QString rv = QString (zarmour_mode_str (self));
67 return rv;
68 }
69
70 ///
71 // Set the mode property.
setMode(int mode)72 void QZarmour::setMode (int mode)
73 {
74 zarmour_set_mode (self, mode);
75
76 }
77
78 ///
79 // Return true if padding is turned on.
pad()80 bool QZarmour::pad ()
81 {
82 bool rv = zarmour_pad (self);
83 return rv;
84 }
85
86 ///
87 // Turn padding on or off. Default is on.
setPad(bool pad)88 void QZarmour::setPad (bool pad)
89 {
90 zarmour_set_pad (self, pad);
91
92 }
93
94 ///
95 // Get the padding character.
padChar()96 char QZarmour::padChar ()
97 {
98 char rv = zarmour_pad_char (self);
99 return rv;
100 }
101
102 ///
103 // Set the padding character.
setPadChar(char padChar)104 void QZarmour::setPadChar (char padChar)
105 {
106 zarmour_set_pad_char (self, padChar);
107
108 }
109
110 ///
111 // Return if splitting output into lines is turned on. Default is off.
lineBreaks()112 bool QZarmour::lineBreaks ()
113 {
114 bool rv = zarmour_line_breaks (self);
115 return rv;
116 }
117
118 ///
119 // Turn splitting output into lines on or off.
setLineBreaks(bool lineBreaks)120 void QZarmour::setLineBreaks (bool lineBreaks)
121 {
122 zarmour_set_line_breaks (self, lineBreaks);
123
124 }
125
126 ///
127 // Get the line length used for splitting lines.
lineLength()128 size_t QZarmour::lineLength ()
129 {
130 size_t rv = zarmour_line_length (self);
131 return rv;
132 }
133
134 ///
135 // Set the line length used for splitting lines.
setLineLength(size_t lineLength)136 void QZarmour::setLineLength (size_t lineLength)
137 {
138 zarmour_set_line_length (self, lineLength);
139
140 }
141
142 ///
143 // Print properties of object
print()144 void QZarmour::print ()
145 {
146 zarmour_print (self);
147
148 }
149
150 ///
151 // Self test of this class.
test(bool verbose)152 void QZarmour::test (bool verbose)
153 {
154 zarmour_test (verbose);
155
156 }
157 /*
158 ################################################################################
159 # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
160 # Read the zproject/README.md for information about making permanent changes. #
161 ################################################################################
162 */
163