1 #pragma once
2 
3 #include <stdint.h>
4 #include <string>
5 
6 #include <android-base/result.h>
7 #include <aconfig_storage/aconfig_storage_read_api.hpp>
8 
9 
10 namespace aconfig_storage {
11 
12 /// Mapped flag value file
13 struct MutableMappedStorageFile : MappedStorageFile {};
14 
15 /// Map a storage file
16 android::base::Result<MutableMappedStorageFile*> map_mutable_storage_file(
17     std::string const& file);
18 
19 /// Set boolean flag value
20 android::base::Result<void> set_boolean_flag_value(
21     const MutableMappedStorageFile& file,
22     uint32_t offset,
23     bool value);
24 
25 /// Set if flag has server override
26 android::base::Result<void> set_flag_has_server_override(
27     const MutableMappedStorageFile& file,
28     FlagValueType value_type,
29     uint32_t offset,
30     bool value);
31 
32 /// Set if flag has local override
33 android::base::Result<void> set_flag_has_local_override(
34     const MutableMappedStorageFile& file,
35     FlagValueType value_type,
36     uint32_t offset,
37     bool value);
38 
39 /// Create flag info file based on package and flag map
40 /// \input package_map: package map file
41 /// \input flag_map: flag map file
42 /// \input flag_info_out: flag info file to be created
43 android::base::Result<void> create_flag_info(
44     std::string const& package_map,
45     std::string const& flag_map,
46     std::string const& flag_info_out);
47 
48 } // namespace aconfig_storage
49