Example-Extension/ExampleExtension/Extension.h

28 lines
519 B
C
Raw Normal View History

2018-10-08 13:37:56 +08:00
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <cstdint>
#include <string>
2019-02-14 07:28:23 +08:00
2018-10-08 13:37:56 +08:00
struct InfoForExtension
{
const char* name;
int64_t value;
};
struct SentenceInfo
{
2019-02-14 07:28:23 +08:00
const InfoForExtension* infoArray;
// nullptr marks end of info array
2018-10-08 13:37:56 +08:00
int64_t operator[](std::string propertyName)
{
2019-02-14 07:28:23 +08:00
for (auto info = infoArray; info->name != nullptr; ++info) if (propertyName == info->name) return info->value;
2018-10-12 03:23:59 +08:00
throw;
2018-10-08 13:37:56 +08:00
}
};
2018-10-12 03:23:59 +08:00
struct SKIP {};
inline void Skip() { throw SKIP(); }