-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSettingsStorage.h
92 lines (73 loc) · 2.41 KB
/
SettingsStorage.h
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#pragma once
#include <list>
#include <atlstr.h>
using namespace ATL;
class CHttpHeaders;
class SettingsStorage
{
CRITICAL_SECTION m_cs;
COLORREF m_colInPT;
COLORREF m_colOutPT;
COLORREF m_colInSSL;
COLORREF m_colOutSSL;
bool m_bShowRequestHeader;
bool m_bShowRequestBody;
bool m_bShowResponseHeader;
bool m_bShowResponseBody;
bool m_bScrollDuringCapture;
bool m_bGroupRequestResponse;
bool m_bBreakOnNext;
bool m_bSaveToFile;
CString m_saveFilename;
std::list<CString> m_lstFilteredContentType;
std::list<CString> m_lstContentTypes;
std::list<int> m_lstFilteredHttpCodes;
void ParseAndPopulateContentTypes(CString& strPersistedContentTypes);
SettingsStorage(void);
~SettingsStorage(void);
public:
static SettingsStorage& GetStorage();
COLORREF GetColInPT() const;
COLORREF GetColInSSL() const;
COLORREF GetColOutPT() const;
COLORREF GetColOutSSL() const;
void SetColInPT(const COLORREF& rColor);
void SetColInSSL(const COLORREF& rColor);
void SetColOutPT(const COLORREF& rColor);
void SetColOutSSL(const COLORREF& rColor);
bool GetShowRequestHeader() const;
bool GetShowRequestBody() const;
bool GetShowResponseHeader() const;
bool GetShowResponseBody() const;
bool GetScrollDuringCapture() const;
bool GetGroupRequestResponse() const;
void SetShowRequestHeader(bool b);
void SetShowRequestBody(bool b);
void SetShowResponseHeader(bool b);
void SetShowResponseBody(bool b);
void SetScrollDuringCapture(bool b);
void SetGroupRequestResponse(bool b);
void SetSaveToFile(bool b);
void SetSaveFilename(const CString& filename);
CString GetSaveFilename() const;
std::list<CString> GetFilteredContentType() const;
std::list<CString> GetContentTypes() const;
bool ShouldBeFiltered(const CHttpHeaders& headers) const;
bool ShouldBeFiltered(int httpStatusCode) const;
bool ShouldBeFiltered(const CString& strContentType) const;
void SetFilteredContentType(std::list<CString>& lstFilteredContentType);
void SetAvailableContentTypes(std::list<CString>& lstContentTypes);
void SetFilteredHttpCodes(std::list<int>& lstFilteredCodes);
bool GetSaveToFile() const;
bool Load();
bool Save();
// Temp
void SetBreakOnNextTransaction(bool bBreak)
{
m_bBreakOnNext = bBreak;
}
bool GetBreakOnNextTransaction() const
{
return m_bBreakOnNext;
}
};