Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,32 @@
# Description

This library provides modern C++ API for WMI interface. The main goal is to write this:

```cpp
for(const auto& o : wmi::WmiMonitorID::get_all_objects())
log(info, "got: %s", o.to_string().c_str());
```

instead of [that](https://docs.microsoft.com/en-us/windows/win32/wmisdk/example--getting-wmi-data-from-the-local-computer-asynchronously).

# Usage

## Prerequisites
- VS2017+ compiler and `/std:c++17` switch

- VS2022 compiler
- [premake5](https://github.com/premake/premake-core/releases)

## Build & Run

```cmd
$ cd modern_wmi
$ premake5 vs2017 --classes=Win32_UserProfile
$ cd wmi_query
$ premake5 vs2022 --classes=WmiMonitorID
$ msbuild /p:Configuration=Release build\modern_wmi.sln
```

Your newly generated API is ready: just use `wmi_classes.h` and `generated_api.lib` which don't require any additional dependencies!

#### Options

- `--classes` delimiter is a comma (`,` or ` `)
- If not defined, will compile all available WMI classes
1 change: 1 addition & 0 deletions src/core/core.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once
#include "config.h"

#include <memory>
#include <functional>
#include <vector>
#include <pugixml.hpp>
Expand Down