-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dirs.cpp
111 lines (94 loc) · 2.39 KB
/
Dirs.cpp
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#include "Dirs.h"
int CDirs::m_index_name = 0;
int CDirs::m_index_attribs = 0;
int CDirs::m_index_permissions = 0;
int CDirs::m_index_flags = 0;
const wxString CDirs::Flags[] =
{
wxT("deleteafterinstall"),
wxT("setntfscompression"),
wxT("uninstalwaysuninstall"),
wxT("uninsneveruninstall"),
wxT("unsetntfscompression")
};
CDirs::CDirs()
{
}
CDirs::~CDirs()
{
}
void CDirs::SetName(const wxString& Name)
{
m_Name = Name;
}
void CDirs::SetAttribs(const wxString& Attribs)
{
m_Attribs = Attribs;
}
void CDirs::SetPermissions(const wxString& Permissions)
{
m_Permissions = Permissions;
}
void CDirs::SetFlags(const wxString& Flags)
{
m_Flags = Flags;
}
void CDirs::WriteInFile(wxTextFile* File)
{
}
#include <manager.h>
#include <logmanager.h>
void CDirs::Analize(const wxString& content, const wxString& line)
{
Manager::Get()->GetLogManager()->Log(content);
wxString cont = content;
wxString part;
wxString settings;
SetLinenumber(line);
while( !cont.empty())
{
part = cont.BeforeFirst(':');
settings = cont.AfterFirst(':').BeforeFirst(';');
cont = cont.AfterFirst(';');
part = part.Trim(false);
settings = settings.Trim(false);
cont = cont.Trim(false);
if( part.CmpNoCase(_T("name")) == 0)
{
SetName(settings);
}
else if( part.CmpNoCase(_T("attribs")) == 0)
{
SetAttribs(settings);
}
else if( part.CmpNoCase(_T("permissions")) == 0)
{
SetPermissions(settings);
}
else if( part.CmpNoCase(_T("flags")) == 0)
{
SetFlags(settings);
}
else if( !CCompTask::Analize(part, settings))
CCommon::Analize(part, settings);
}
}
void CDirs::FillContent(wxListCtrl* liste)
{
liste->SetItem(GetIndex(), m_index_name, m_Name);
liste->SetItem(GetIndex(), m_index_attribs, m_Attribs);
liste->SetItem(GetIndex(), m_index_permissions, m_Permissions);
liste->SetItem(GetIndex(), m_index_flags, m_Flags);
CCompTask::FillContent(liste, GetIndex());
CCommon::FillContent(liste, GetIndex());
}
void CDirs::AddHeader(wxListCtrl* liste)
{
InsertHeader(liste);
m_index_name = liste->InsertColumn(liste->GetColumnCount(), _T("Name"));
m_index_attribs = liste->InsertColumn(liste->GetColumnCount(), _T("Attribs"));
m_index_permissions = liste->InsertColumn(liste->GetColumnCount(), _T("Permissions"));
m_index_flags = liste->InsertColumn(liste->GetColumnCount(), _T("Flags"));
CCompTask::AddHeader(liste);
CCommon::AddHeader(liste);
}