1
0
mirror of synced 2024-11-12 10:10:53 +01:00

lang: Add dataSize function to get size of loaded data

This commit is contained in:
WerWolv 2021-03-02 13:55:43 +01:00
parent de327cf3a4
commit 3a7a3a6e9c

View File

@ -195,6 +195,11 @@ namespace hex::plugin::builtin {
return new ASTNodeIntegerLiteral({ Token::ValueType::Unsigned64Bit, u64(result) });
});
/* dataSize() */
ContentRegistry::PatternLanguageFunctions::add("dataSize", ContentRegistry::PatternLanguageFunctions::NoParameters, [](auto &ctx, auto params) -> ASTNode* {
return new ASTNodeIntegerLiteral({ Token::ValueType::Unsigned64Bit, u64(SharedData::currentProvider->getActualSize()) });
});
}
}