WiiUPluginSystem/include/wups/config/WUPSConfigItemStub.h

49 lines
1.3 KiB
C
Raw Permalink Normal View History

#pragma once
#include <wups/config.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct ConfigItemStub {
WUPSConfigItemHandle handle;
} ConfigItemStub;
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);
#ifdef __cplusplus
}
#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