-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathQueryRunner.hpp
61 lines (46 loc) · 1.35 KB
/
QueryRunner.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
////////////////////////////////////////////////////////////////////////////////
//! \file QueryRunner.hpp
//! \brief The QueryRunner class declaration.
//! \author Chris Oldwood
// Check for previous inclusion
#ifndef APP_QUERYRUNNER_HPP
#define APP_QUERYRUNNER_HPP
#if _MSC_VER > 1000
#pragma once
#endif
#include "Queries.hpp"
// Forward declarations.
namespace WCL
{
class Variant;
}
namespace WMI
{
class Connection;
}
////////////////////////////////////////////////////////////////////////////////
//! The runner for the WMI queries.
class QueryRunner
{
public:
//! The type used for the query sequence.
typedef Queries::const_iterator const_iterator;
//! The type used for the query results.
typedef std::vector<tstring> Results;
public:
//
// Methods.
//
//! Execute a single query against a host.
static tstring run(WMI::Connection& connection, const ConstQueryPtr& query);
//! Execute the queries for a host.
static Results run(WMI::Connection& connection, const ConstQueryPtr* begin, const ConstQueryPtr* end);
//! Execute the queries for a host.
static Results run(WMI::Connection& connection, const_iterator begin, const_iterator end);
//
// Internal methods.
//
//! Format the value according to the custom format string.
static tstring formatValue(const WCL::Variant& value, const tstring& format);
};
#endif // APP_QUERYRUNNER_HPP