mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-04-20 06:59:13 -04:00
Refactor phonebook's models to merge both implementation. One model class is used for both main and search results windows. Improve search by matching entered string against: - first_name " " last_name - last_name " " fist_name Sort results by last_name " " first_name, favs first. Small improvement to the list view has been added to deal with asynchronous db reads. Signed-off-by: Marcin Smoczyński <smoczynski.marcin@gmail.com>
36 lines
705 B
C++
36 lines
705 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace db
|
|
{
|
|
/// virtual query input interface
|
|
class Query
|
|
{
|
|
public:
|
|
enum class Type
|
|
{
|
|
Create,
|
|
Read,
|
|
Update,
|
|
Delete
|
|
};
|
|
|
|
Query(Type type) : type(type)
|
|
{}
|
|
virtual ~Query() = default;
|
|
|
|
const Type type;
|
|
|
|
[[nodiscard]] virtual auto debugInfo() const -> std::string = 0;
|
|
};
|
|
|
|
/// virtual query output (result) interface
|
|
class QueryResult
|
|
{
|
|
public:
|
|
virtual ~QueryResult() = default;
|
|
[[nodiscard]] virtual auto debugInfo() const -> std::string = 0;
|
|
};
|
|
} // namespace db
|