From b58c08150853b8055093dc116d407ffd543f8ec8 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 30 Oct 2023 15:47:38 +1100 Subject: add locale-aware colation to db indexes --- src/system_fsm/include/service_locator.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/system_fsm/include') diff --git a/src/system_fsm/include/service_locator.hpp b/src/system_fsm/include/service_locator.hpp index 1dcf0f5e..24dc1eb9 100644 --- a/src/system_fsm/include/service_locator.hpp +++ b/src/system_fsm/include/service_locator.hpp @@ -10,6 +10,7 @@ #include "battery.hpp" #include "bluetooth.hpp" +#include "collation.hpp" #include "database.hpp" #include "gpios.hpp" #include "nvs.hpp" @@ -101,6 +102,15 @@ class ServiceLocator { queue_ = std::move(i); } + auto collator() -> locale::ICollator& { + assert(collator_ != nullptr); + return *collator_; + } + + auto collator(std::unique_ptr i) { + collator_ = std::move(i); + } + // Not copyable or movable. ServiceLocator(const ServiceLocator&) = delete; ServiceLocator& operator=(const ServiceLocator&) = delete; @@ -117,6 +127,7 @@ class ServiceLocator { std::shared_ptr database_; std::unique_ptr tag_parser_; + std::unique_ptr collator_; drivers::SdState sd_; }; -- cgit v1.2.3