18using blender::string_search::RecentCache;
49 return &storage.
cache;
56 if (!user_config_dir.has_value()) {
62 return std::string(filepath);
84 values.
append({item.value, item.key});
86 std::sort(values.
begin(), values.
end());
88 fstream file(*path, std::ios::out);
89 for (
const auto &item : values) {
90 file.write(item.second.data(), item.second.size());
112 while (std::getline(file, line)) {
#define BLENDER_RECENT_SEARCHES_FILE
std::optional< std::string > BKE_appdir_folder_id_create(int folder_id, const char *subfolder) ATTR_WARN_UNUSED_RESULT
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
File and directory operations.
#define BLI_path_join(...)
@ USER_FLAG_RECENT_SEARCHES_DISABLE
bool add_overwrite(const Key &key, const Value &value)
ItemIterator items() const &
void append(const T &value)
static RecentCacheStorage & get_recent_cache_storage()
void add_recent_search(StringRef chosen_str)
void read_recent_searches_file()
void write_recent_searches_file()
static std::optional< std::string > get_recent_searches_file_path()
const blender::string_search::RecentCache * get_recent_cache_or_null()
Map< std::string, int > logical_time_by_str