forked from OCSInventory-NG/WindowsAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMonitor.cpp
120 lines (97 loc) · 2.46 KB
/
Monitor.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
111
112
113
114
115
116
117
118
119
120
//====================================================================================
// Open Computer and Software Inventory Next Generation
// Copyright (C) 2010 OCS Inventory NG Team. All rights reserved.
// Web: http://www.ocsinventory-ng.org
// This code is open source and may be copied and modified as long as the source
// code is always made freely available.
// Please refer to the General Public Licence V2 http://www.gnu.org/ or Licence.txt
//====================================================================================
// Monitor.cpp: implementation of the CMonitor class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Monitor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMonitor::CMonitor()
{
}
CMonitor::~CMonitor()
{
}
LPCTSTR CMonitor::GetManufacturer()
{
return m_csManufacturer;
}
LPCTSTR CMonitor::GetType()
{
return m_csType;
}
LPCTSTR CMonitor::GetCaption()
{
return m_csCaption;
}
LPCTSTR CMonitor::GetDescription()
{
return m_csDescription;
}
LPCTSTR CMonitor::GetSerial()
{
return m_csSerial;
}
void CMonitor::SetManufacturer(LPCTSTR lpstrManufacturer)
{
m_csManufacturer = lpstrManufacturer;
StrForSQL( m_csManufacturer);
}
void CMonitor::SetType(LPCTSTR lpstrType)
{
m_csType = lpstrType;
StrForSQL( m_csType);
}
void CMonitor::SetCaption(LPCTSTR lpstrCaption)
{
m_csCaption = lpstrCaption;
StrForSQL( m_csCaption);
}
void CMonitor::SetDescription(LPCTSTR lpstrDescription)
{
m_csDescription = lpstrDescription;
StrForSQL( m_csDescription);
}
void CMonitor::SetSerial(LPCTSTR lpstrSerial)
{
m_csSerial = lpstrSerial;
StrForSQL( m_csSerial);
}
BOOL CMonitor::IsValidSerial( LPCTSTR lpstrSN)
{
CString csSN;
if (lpstrSN == NULL)
csSN = m_csSerial;
else
csSN = lpstrSN;
return (csSN.GetLength() > SYSINFO_MIN_SN_LENGTH);
}
void CMonitor::Clear()
{
m_csManufacturer.Empty();
m_csType.Empty();
m_csCaption.Empty();
m_csDescription.Empty();
m_csSerial.Empty();
}
int CMonitor::operator==(CMonitor cObject) const
{
return ((m_csManufacturer == cObject.GetManufacturer()) &&
(m_csType == cObject.GetType()) &&
(m_csCaption == cObject.GetCaption()) &&
(m_csDescription == cObject.GetDescription()) &&
(m_csSerial == cObject.GetSerial()));
}