blob: 234713e764aa42113a7d55011ff4e5e2bf8fe5b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
//
// MCConnectionLoggerUtils.cc
// mailcore2
//
// Created by DINH Viêt Hoà on 6/24/13.
// Copyright (c) 2013 MailCore. All rights reserved.
//
#include "MCConnectionLoggerUtils.h"
#include <libetpan/libetpan.h>
#include "MCConnectionLogger.h"
mailcore::ConnectionLogType mailcore::getConnectionType(int log_type)
{
ConnectionLogType type = (ConnectionLogType) -1;
bool isBuffer = false;
switch (log_type) {
case MAILSTREAM_LOG_TYPE_ERROR_PARSE:
type = ConnectionLogTypeErrorParse;
isBuffer = true;
break;
case MAILSTREAM_LOG_TYPE_ERROR_RECEIVED:
type = ConnectionLogTypeErrorReceived;
isBuffer = true;
break;
case MAILSTREAM_LOG_TYPE_ERROR_SENT:
type = ConnectionLogTypeErrorSent;
isBuffer = true;
break;
case MAILSTREAM_LOG_TYPE_DATA_RECEIVED:
type = ConnectionLogTypeReceived;
isBuffer = true;
break;
case MAILSTREAM_LOG_TYPE_DATA_SENT:
type = ConnectionLogTypeSent;
isBuffer = true;
break;
case MAILSTREAM_LOG_TYPE_DATA_SENT_PRIVATE:
type = ConnectionLogTypeSentPrivate;
isBuffer = true;
break;
}
return type;
}
bool mailcore::isBufferFromLogType(int log_type)
{
bool isBuffer = false;
switch (log_type) {
case MAILSTREAM_LOG_TYPE_ERROR_PARSE:
case MAILSTREAM_LOG_TYPE_DATA_RECEIVED:
case MAILSTREAM_LOG_TYPE_DATA_SENT:
case MAILSTREAM_LOG_TYPE_DATA_SENT_PRIVATE:
isBuffer = true;
break;
}
return isBuffer;
}
|