mirror of
https://github.com/Artikash/Example-Extension.git
synced 2024-11-10 11:35:35 +08:00
28 lines
582 B
C++
28 lines
582 B
C++
#pragma once
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#include <cstdint>
|
|
#include <string>
|
|
|
|
|
|
struct InfoForExtension
|
|
{
|
|
const char* name;
|
|
int64_t value;
|
|
};
|
|
|
|
struct SentenceInfo
|
|
{
|
|
const InfoForExtension* infoArray;
|
|
int64_t operator[](std::string propertyName)
|
|
{
|
|
for (auto info = infoArray; info->name; ++info) // nullptr name marks end of info array
|
|
if (propertyName == info->name) return info->value;
|
|
return *(int*)0xcccc = 0; // gives better error message than alternatives
|
|
}
|
|
};
|
|
|
|
struct SKIP {};
|
|
inline void Skip() { throw SKIP(); }
|