MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / GetDeviceProperty

Method GetDeviceProperty

WinArk/DeviceManagerView.cpp:176–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174}
175
176CString CDeviceManagerView::GetDeviceProperty(DeviceInfo& di, int index) const {
177 CString result;
178 auto& prop = m_Items[index];
179 switch (prop.Type) {
180 case ItemType::String:
181 result = m_DevMgr->GetDeviceRegistryPropertyString(di, prop.PropertyType).c_str();
182 break;
183
184 case ItemType::MultiString:
185 for (auto& str : m_DevMgr->GetDeviceRegistryPropertyMultiString(di, prop.PropertyType))
186 result += str.c_str() + CString(L", ");
187 if (!result.IsEmpty())
188 result = result.Left(result.GetLength() - 2);
189 break;
190
191 case ItemType::Dword:
192 result.Format(L"%08X", m_DevMgr->GetDeviceRegistryProperty<DWORD>(di, prop.PropertyType));
193 break;
194
195 case ItemType::Boolean:
196 result = m_DevMgr->GetDeviceRegistryProperty<DWORD>(di, prop.PropertyType) ? L"Yes" : L"No";
197 break;
198
199 }
200
201 return result;
202}
203
204bool CDeviceManagerView::CompareItems(const CString& i1, const CString& i2, bool asc) {
205 return SortHelper::SortStrings(i1, i2, asc);

Callers

nothing calls this directly

Calls 4

IsEmptyMethod · 0.80
GetLengthMethod · 0.45

Tested by

no test coverage detected