mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-18 10:58:33 -05:00
* Switched to DB initialization at compile time * Organized and cleaned up db files directories(not finished completely) * Fixed DB related unit tests * Minor improvements to CMake * Small fixes for GCC12 build
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
|
|
namespace db
|
|
{
|
|
|
|
class Query;
|
|
class QueryResult;
|
|
|
|
class Interface
|
|
{
|
|
public:
|
|
virtual std::unique_ptr<db::QueryResult> runQuery(std::shared_ptr<db::Query> query);
|
|
|
|
enum class Name
|
|
{
|
|
AlarmEvents,
|
|
SMS,
|
|
SMSThread,
|
|
SMSTemplate,
|
|
Contact,
|
|
Notes,
|
|
Calllog,
|
|
Notifications,
|
|
Quotes,
|
|
MultimediaFiles
|
|
};
|
|
};
|
|
}; // namespace db
|
|
|
|
constexpr const char *c_str(enum db::Interface::Name db)
|
|
{
|
|
switch (db) {
|
|
case db::Interface::Name::AlarmEvents:
|
|
return "AlarmEvents";
|
|
case db::Interface::Name::SMS:
|
|
return "SMS";
|
|
case db::Interface::Name::SMSThread:
|
|
return "SMSThread";
|
|
case db::Interface::Name::SMSTemplate:
|
|
return "SMSTemplate";
|
|
case db::Interface::Name::Contact:
|
|
return "Contact";
|
|
case db::Interface::Name::Notes:
|
|
return "Notes";
|
|
case db::Interface::Name::Calllog:
|
|
return "Callog";
|
|
case db::Interface::Name::Notifications:
|
|
return "Notifications";
|
|
case db::Interface::Name::Quotes:
|
|
return "Quotes";
|
|
case db::Interface::Name::MultimediaFiles:
|
|
return "MultimediaFiles";
|
|
};
|
|
return "";
|
|
}
|