Expand description
§Numby Library
This library provides the core functionality for the Numby natural language calculator.
§Modules
config: Configuration loading and management.evaluator: Expression evaluation and conversions.models: Data structures and state management.parser: Parsing utilities and regex replacements.conversions: Unit and currency conversion functions.prettify: Number formatting for display.security: Path validation and input sanitization.i18n: Internationalization and localization support.
Modules§
- config
- Configuration management for Numby calculator.
- conversions
- Unit and currency conversion functions.
- currency_
fetcher - Currency exchange rate fetching from external APIs.
- evaluator
- Expression evaluation and agent registry.
- highlight
- i18n
- line_
groups - models
- Core data structures for application state and agents.
- parser
- Expression parsing and preprocessing utilities.
- prettify
- Number formatting utilities for pretty display.
- security
- Security utilities for input validation and path sanitization.
Macros§
- fl
- Macro for easy localization without arguments
Structs§
Functions§
- libnumby_
are_ rates_ stale - Checks if currency rates are stale (older than 24 hours)
- libnumby_
clear_ ⚠history - Safety
- libnumby_
clear_ ⚠variables - Clear all variables from the context
- libnumby_
complete_ ⚠variable - Return the common completion suffix for the variable at a UTF-16 cursor offset. The caller frees the returned string with libnumby_free_string.
- libnumby_
context_ ⚠free - Safety
- libnumby_
context_ new - libnumby_
evaluate ⚠ - Safety
- libnumby_
free_ ⚠highlight_ spans - Frees highlight spans returned by libnumby_highlight_spans.
- libnumby_
free_ ⚠string - Safety
- libnumby_
get_ api_ rates_ date - Gets the API rates date (when the rates were published by the API)
- libnumby_
get_ default_ config_ path - Returns the default config path used by the Rust core.
- libnumby_
get_ ⚠history_ count - Safety
- libnumby_
get_ ⚠locale - Get the current locale
- libnumby_
get_ ⚠locale_ code - Get locale code at index
- libnumby_
get_ ⚠locale_ name - Get locale display name at index
- libnumby_
get_ ⚠locales_ count - Get the number of available locales
- libnumby_
get_ rates_ update_ date - Gets the last update date for currency rates (when we last fetched)
- libnumby_
group_ ⚠bounds_ for_ cursor - Returns the start/end line indices for the multiline group containing the cursor.
- libnumby_
group_ ⚠expr_ for_ cursor - Returns the multiline group expression containing the cursor.
- libnumby_
highlight_ ⚠spans - Returns a heap-allocated array of highlight spans. Caller must free using libnumby_free_highlight_spans.
- libnumby_
load_ ⚠config - Safety
- libnumby_
set_ ⚠currency_ rates_ json - Sets currency rates from JSON data provided by the caller (e.g., from Swift URLSession)
- libnumby_
set_ ⚠locale - Safety
- libnumby_
set_ ⚠number_ format - Safety
- libnumby_
set_ ⚠variable - Safety
- libnumby_
update_ ⚠currency_ rates - Fetches latest currency rates from the API and updates the config file