xref: /aosp_15_r20/external/executorch/backends/apple/coreml/runtime/kvstore/json_key_value_store.cpp (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 //
2 //  json_key_value_store.cpp
3 //
4 // Copyright © 2024 Apple Inc. All rights reserved.
5 //
6 // Please refer to the license found in the LICENSE file in the root directory of the source tree.
7 
8 #include <json_key_value_store.hpp>
9 
10 namespace executorchcoreml {
11 namespace sqlite {
12 
string_from_unowned_value(const sqlite::UnOwnedValue & value)13 std::string string_from_unowned_value(const sqlite::UnOwnedValue& value) {
14     auto unowned_string = std::get<sqlite::UnOwnedString>(value);
15     std::string result;
16     result.assign(unowned_string.data, unowned_string.size);
17     return result;
18 }
19 
20 
21 } // namespace sqlite
22 } // namespace executorchcoreml
23