Skip to content

Commit

Permalink
[dbgui.data_store] basic filtering for datastore values
Browse files Browse the repository at this point in the history
  • Loading branch information
harrand committed Mar 5, 2024
1 parent 9d6883c commit cc6b3db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/tz/core/data/data_store.dbgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,22 @@ namespace tz
{
this->clear();
}
static std::string filter = "";
if(ImGui::Button("x"))
{
filter.clear();
}
ImGui::SameLine();
ImGui::InputText("Filter", &filter);
ImGui::Separator();
if(ImGui::BeginTable("datastore", 2))
{
for(const auto& [key, val] : store_cpy)
{
if(!filter.empty() && !key.starts_with(filter))
{
continue;
}
int hash = std::hash<std::string>{}(key);
ImGui::PushID(hash);
ImGui::TableNextRow();
Expand Down

0 comments on commit cc6b3db

Please sign in to comment.