Switch to unified view

a/src/bincimapmime/iodevice.h b/src/bincimapmime/iodevice.h
1
/*-*-mode:c++-*-*/
1
/*-*-mode:c++;c-basic-offset:2-*-*/
2
/*  --------------------------------------------------------------------
2
/*  --------------------------------------------------------------------
3
 *  Filename:
3
 *  Filename:
4
 *    src/iodevice.h
4
 *    src/iodevice.h
5
 *  
5
 *  
6
 *  Description:
6
 *  Description:
...
...
149
149
150
      \sa setTimeout()
150
      \sa setTimeout()
151
    */
151
    */
152
    unsigned int getTimeout(void) const;
152
    unsigned int getTimeout(void) const;
153
153
154
    enum LogLevel {
155
      ErrorLevel,
156
      InfoLevel,
157
      WarningLevel,
158
      DebugLevel
159
    };
160
    
154
    /*!
161
    /*!
155
      Sets the output level for the following write operations on this
162
      Sets the output level for the following write operations on this
156
      device.
163
      device.
157
164
158
      The output level is a number which gives the following write
165
      The output level is a number which gives the following write
...
...
170
      operations that are done with output level 0 are never ignored.
177
      operations that are done with output level 0 are never ignored.
171
178
172
      \param level The output level
179
      \param level The output level
173
      \sa getOutputLevel(), setOutputLevelLimit()
180
      \sa getOutputLevel(), setOutputLevelLimit()
174
    */
181
    */
175
    void setOutputLevel(unsigned int level);
182
    void setOutputLevel(LogLevel level);
176
183
177
    /*!
184
    /*!
178
      Returns the current output level.
185
      Returns the current output level.
179
186
180
      \sa setOutputLevel()
187
      \sa setOutputLevel()
181
    */
188
    */
182
    unsigned int getOutputLevel(void) const;
189
    LogLevel getOutputLevel(void) const;
183
190
184
    /*!
191
    /*!
185
      Sets the current output level limit. Write operations with a
192
      Sets the current output level limit. Write operations with a
186
      level higher than the output level limit are ignored.
193
      level higher than the output level limit are ignored.
187
194
188
      \param level The output level limit
195
      \param level The output level limit
189
      \sa setOutputLevel()
196
      \sa setOutputLevel()
190
    */
197
    */
191
    void setOutputLevelLimit(unsigned int level);
198
    void setOutputLevelLimit(LogLevel level);
192
199
193
    /*!
200
    /*!
194
      Returns the current output level limit.
201
      Returns the current output level limit.
195
202
196
      \sa setOutputLevelLimit()
203
      \sa setOutputLevelLimit()
197
    */
204
    */
198
    unsigned int getOutputLevelLimit(void) const;
205
    LogLevel getOutputLevelLimit(void) const;
199
206
200
    /*!
207
    /*!
201
      Returns the number of bytes that have been read from this device
208
      Returns the number of bytes that have been read from this device
202
      since it was created.
209
      since it was created.
203
    */
210
    */
...
...
207
      Returns the number of bytes that have been written to this
214
      Returns the number of bytes that have been written to this
208
      device since it was created.
215
      device since it was created.
209
    */
216
    */
210
    unsigned int getWriteCount(void) const;
217
    unsigned int getWriteCount(void) const;
211
218
219
    /*!
220
      Calling this function enables the built-in protocol dumping feature in
221
      the device. All input and output to this device will be dumped to a file
222
      in /tmp.
223
    */
212
    void enableProtocolDumping(void);
224
    void enableProtocolDumping(void);
213
225
214
    /*!
226
    /*!
215
      Writes data to the device. Depending on the value of the max
227
      Writes data to the device. Depending on the value of the max
216
      output buffer size, the data may not be written immediately.
228
      output buffer size, the data may not be written immediately.
...
...
354
    unsigned int timeout;
366
    unsigned int timeout;
355
367
356
    unsigned int readCount;
368
    unsigned int readCount;
357
    unsigned int writeCount;
369
    unsigned int writeCount;
358
370
359
    unsigned int outputLevel;
371
    LogLevel outputLevel;
360
    unsigned int outputLevelLimit;
372
    LogLevel outputLevelLimit;
361
373
362
    Error error;
374
    mutable Error error;
363
    std::string errorString;
375
    mutable std::string errorString;
364
376
365
    int dumpfd;
377
    int dumpfd;
366
  };
378
  };
367
379
368
  //----------------------------------------------------------------------
380
  //----------------------------------------------------------------------