-
Notifications
You must be signed in to change notification settings - Fork 0
/
anonymizer.h
83 lines (79 loc) · 2.71 KB
/
anonymizer.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
#ifndef ANONYMIZER_H
#define ANONYMIZER_H
#include <settings.h>
#include <privateinfo.h>
#include <regex>
/*!
* \class Anonymizer
* \brief The Anonymizer is implements methods to anonymize input logs
* \since v 0.0.1
*/
class Anonymizer
{
public:
/*!
\fn Anonymizer()
Default Constructs
*/
Anonymizer();
/*!
\fn ~Anonymizer()
Default Deconstructs
delete settings and privateInfo pointers
*/
~Anonymizer();
/*!
\fn string anonymize(string input, string projectName)
Takes logs to be anonymized as \a input and specified project directory name as \a projectDirName
and anonymize the input logs according to
* user settings
* whether the project name is empty or not
and Returns a anonymized string
*/
string anonymize(string input, string projectDirName);
private:
/*!
Pointer to a instance of Settings class
which is used retrieve user settings
*/
Settings *settings;
/*!
Pointer to a instance of PrivateInfo class
which is used retrieve user private information
like OS, home directory
*/
PrivateInfo *privateInfo;
/*!
\fn string hideAbsPaths(string input)
Takes logs to be anonymized as \a input and anonymize the input logs by
hiding the absolute paths
in Windows this will be Drive Letter ex: D:,
in Linux this will be users home directory ex: /home/username/
and Returns a anonymized string
*/
string hideAbsPaths(string input);
/*!
\fn string hideIps(string input)
Takes logs to be anonymized as \a input and anonymize the input logs by
hiding the IPv4 and IPv6 addresses
and Returns a anonymized string
*/
string hideIps(string input);
/*!
\fn string hideMacs(string input)
Takes logs to be anonymized as \a input and anonymize the input logs by
hiding the MAC addresses addresses where sections separated by
hyphens (-) or colons(:)
and Returns a anonymized string
*/
string hideMacs(string input);
/*!
\fn string hideProjectDirName(string projectName, string input)
Takes project directory name as \a projectDirName,
logs to be anonymized as \a input and anonymize the input logs by
hiding project directory names and files containing project directory names
and Returns a anonymized string
*/
string hideProjectDirName(string projectDirName, string input);
};
#endif // ANONYMIZER_H