#pragma once

#include "fsearch_array.h"
#include "fsearch_database_index_properties.h"

#include <gio/gio.h>
#include <stdbool.h>

void
fsearch_database_sort_results(FsearchDatabaseIndexProperty old_sort_order,
                              FsearchDatabaseIndexProperty old_secondary_sort_order,
                              FsearchDatabaseIndexProperty new_sort_order,
                              DynamicArray *files_in,
                              DynamicArray *folders_in,
                              DynamicArray *files_fast_sort_index,
                              DynamicArray *folders_fast_sort_index,
                              DynamicArray **files_out,
                              DynamicArray **folders_out,
                              FsearchDatabaseIndexProperty *sort_order_out,
                              FsearchDatabaseIndexProperty *secondary_sort_order_out,
                              GCancellable *cancellable);

DynamicArrayCompareDataFunc
fsearch_database_sort_get_compare_func_for_property(FsearchDatabaseIndexProperty property, bool is_dir);