forked from Public-Mirror/Textractor
better error message
This commit is contained in:
parent
447400980e
commit
ce33ca5732
@ -11,11 +11,11 @@ struct InfoForExtension
|
|||||||
struct SentenceInfo
|
struct SentenceInfo
|
||||||
{
|
{
|
||||||
const InfoForExtension* infoArray;
|
const InfoForExtension* infoArray;
|
||||||
// nullptr marks end of info array
|
|
||||||
int64_t operator[](std::string propertyName)
|
int64_t operator[](std::string propertyName)
|
||||||
{
|
{
|
||||||
for (auto info = infoArray; info->name; ++info) if (propertyName == info->name) return info->value;
|
for (auto info = infoArray; info->name; ++info) // nullptr name marks end of info array
|
||||||
throw;
|
if (propertyName == info->name) return info->value;
|
||||||
|
return *(int*)0xcccc = 0; // gives better error message than alternatives
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static InfoForExtension DUMMY[2] = { { "text number", 1 } };
|
inline static InfoForExtension DUMMY[2] = { { "text number", 1 } };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user