-
Notifications
You must be signed in to change notification settings - Fork 21
/
Win32_LogicalDisk.hpp
83 lines (60 loc) · 1.95 KB
/
Win32_LogicalDisk.hpp
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
////////////////////////////////////////////////////////////////////////////////
//! \file Win32_LogicalDisk.hpp
//! \brief The Win32_LogicalDisk class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef WMI_WIN32_LOGICALDISK_HPP
#define WMI_WIN32_LOGICALDISK_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include "TypedObject.hpp"
namespace WMI
{
////////////////////////////////////////////////////////////////////////////////
//! The C++ facade for the Win32_LogicalDisk WMI class.
class Win32_LogicalDisk : public TypedObject<Win32_LogicalDisk>
{
public:
//! Construction from the underlying COM object and connection.
Win32_LogicalDisk(IWbemClassObjectPtr object, const Connection& connection);
//! Destructor.
virtual ~Win32_LogicalDisk();
//
// WMI typed properties.
//
//! Unique identifier of the logical disk from other devices on the system.
tstring DeviceID() const;
//! Space available on the logical disk.
uint64 FreeSpace() const;
//! Size of the disk drive.
uint64 Size() const;
//
// Constants.
//
//! The WMI class name this type mirrors.
static const tchar* WMI_CLASS_NAME;
};
////////////////////////////////////////////////////////////////////////////////
//! Unique identifier of the logical disk from other devices on the system.
inline tstring Win32_LogicalDisk::DeviceID() const
{
return getProperty<tstring>(TXT("DeviceID"));
}
////////////////////////////////////////////////////////////////////////////////
//! Space available on the logical disk.
inline uint64 Win32_LogicalDisk::FreeSpace() const
{
tstring value = getProperty<tstring>(TXT("FreeSpace"));
return Core::parse<uint64>(value);
}
////////////////////////////////////////////////////////////////////////////////
//! Size of the disk drive.
inline uint64 Win32_LogicalDisk::Size() const
{
tstring value = getProperty<tstring>(TXT("Size"));
return Core::parse<uint64>(value);
}
//namespace WMI
}
#endif // WMI_WIN32_LOGICALDISK_HPP