2023-12-16 17:10:45 +01:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <wups/config.h>
|
2022-09-18 23:57:23 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct ConfigItemStub {
|
|
|
|
WUPSConfigItemHandle handle;
|
|
|
|
} ConfigItemStub;
|
|
|
|
|
2023-12-16 17:10:45 +01:00
|
|
|
WUPSConfigAPIStatus WUPSConfigItemStub_Create(const char *displayName,
|
|
|
|
WUPSConfigItemHandle *outHandle);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Adds a stub item to a category to display information
|
|
|
|
*
|
|
|
|
* @param cat The handle of the category to which the item should be added.
|
|
|
|
* @param displayName The display name of the item.
|
|
|
|
* @return true if the item was added successfully, false otherwise.
|
|
|
|
*/
|
|
|
|
WUPSConfigAPIStatus
|
|
|
|
WUPSConfigItemStub_AddToCategory(WUPSConfigCategoryHandle cat, const char *displayName);
|
2022-09-18 23:57:23 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2023-12-16 17:10:45 +01:00
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
|
|
|
#include "WUPSConfigItem.h"
|
|
|
|
#include <optional>
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
#include <wups/config_api.h>
|
|
|
|
|
|
|
|
class WUPSConfigItemStub : public WUPSConfigItem {
|
|
|
|
public:
|
|
|
|
static std::optional<WUPSConfigItemStub> Create(std::string_view displayName,
|
|
|
|
WUPSConfigAPIStatus &err) noexcept;
|
|
|
|
|
|
|
|
static WUPSConfigItemStub Create(std::string_view displayName);
|
|
|
|
|
|
|
|
private:
|
|
|
|
explicit WUPSConfigItemStub(WUPSConfigItemHandle itemHandle) : WUPSConfigItem(itemHandle) {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
#endif
|