Initial commit: HTab spreadsheet engine and GemUI X11 frontend
This commit is contained in:
commit
395f458fee
55 files changed
+12682
No files matched your search
@@ -0,0 +1,31 @@
|
||||
#include "engine/functions/registry.hpp"
|
||||
|
||||
namespace htab {
|
||||
|
||||
const FunctionRegistry& FunctionRegistry::instance() {
|
||||
static const FunctionRegistry reg;
|
||||
return reg;
|
||||
}
|
||||
|
||||
FunctionRegistry::FunctionRegistry() {
|
||||
register_math_trig_functions(*this);
|
||||
register_logical_functions(*this);
|
||||
register_statistical_functions(*this);
|
||||
register_lookup_functions(*this);
|
||||
register_text_functions(*this);
|
||||
register_datetime_functions(*this);
|
||||
register_financial_functions(*this);
|
||||
register_database_functions(*this);
|
||||
}
|
||||
|
||||
void FunctionRegistry::register_fn(std::string name, FunctionImpl fn) {
|
||||
funcs_.emplace(std::move(name), std::move(fn));
|
||||
}
|
||||
|
||||
const FunctionImpl* FunctionRegistry::find(std::string_view upper_name) const {
|
||||
auto it = funcs_.find(std::string(upper_name));
|
||||
if (it == funcs_.end()) return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
} // namespace htab
|
||||
Reference in new issue
Block a user