From 7d7f7755d17e1e0a2348d75d797097f166b70471 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 21:41:56 +1000 Subject: start moving include files into subdirs --- src/tangara/database/database.cpp | 22 +++++++++++----------- src/tangara/database/database.hpp | 10 +++++----- src/tangara/database/env_esp.cpp | 4 ++-- src/tangara/database/file_gatherer.cpp | 2 +- src/tangara/database/file_gatherer.hpp | 12 +++++------- src/tangara/database/future_fetcher.hpp | 2 +- src/tangara/database/index.cpp | 11 ++++++----- src/tangara/database/index.hpp | 7 ++++--- src/tangara/database/records.cpp | 6 +++--- src/tangara/database/records.hpp | 4 ++-- src/tangara/database/tag_parser.cpp | 2 +- src/tangara/database/tag_parser.hpp | 2 +- src/tangara/database/test/test_database.cpp | 16 ++++++++-------- src/tangara/database/test/test_records.cpp | 2 +- src/tangara/database/track.cpp | 2 +- 15 files changed, 52 insertions(+), 52 deletions(-) (limited to 'src/tangara/database') diff --git a/src/tangara/database/database.cpp b/src/tangara/database/database.cpp index 48fb0c63..ddb63907 100644 --- a/src/tangara/database/database.cpp +++ b/src/tangara/database/database.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "database.hpp" +#include "database/database.hpp" #include #include @@ -23,10 +23,10 @@ #include "collation.hpp" #include "cppbor.h" #include "cppbor_parse.h" +#include "database/index.hpp" #include "esp_log.h" #include "ff.h" #include "freertos/projdefs.h" -#include "index.hpp" #include "komihash.h" #include "leveldb/cache.h" #include "leveldb/db.h" @@ -36,17 +36,17 @@ #include "leveldb/status.h" #include "leveldb/write_batch.h" -#include "db_events.hpp" -#include "env_esp.hpp" -#include "event_queue.hpp" -#include "file_gatherer.hpp" +#include "database/db_events.hpp" +#include "database/env_esp.hpp" +#include "database/file_gatherer.hpp" +#include "database/records.hpp" +#include "database/tag_parser.hpp" +#include "database/track.hpp" +#include "events/event_queue.hpp" #include "memory_resource.hpp" -#include "records.hpp" #include "result.hpp" #include "spi.hpp" -#include "tag_parser.hpp" #include "tasks.hpp" -#include "track.hpp" namespace database { @@ -63,8 +63,8 @@ static const char kKeyTrackId[] = "next_track_id"; static std::atomic sIsDbOpen(false); -static auto CreateNewDatabase(leveldb::Options& options, locale::ICollator& col) - -> leveldb::DB* { +static auto CreateNewDatabase(leveldb::Options& options, + locale::ICollator& col) -> leveldb::DB* { Database::Destroy(); leveldb::DB* db; options.create_if_missing = true; diff --git a/src/tangara/database/database.hpp b/src/tangara/database/database.hpp index 35b76a13..d2de7c72 100644 --- a/src/tangara/database/database.hpp +++ b/src/tangara/database/database.hpp @@ -19,19 +19,19 @@ #include "collation.hpp" #include "cppbor.h" -#include "file_gatherer.hpp" -#include "index.hpp" +#include "database/file_gatherer.hpp" +#include "database/index.hpp" +#include "database/records.hpp" +#include "database/tag_parser.hpp" +#include "database/track.hpp" #include "leveldb/cache.h" #include "leveldb/db.h" #include "leveldb/iterator.h" #include "leveldb/options.h" #include "leveldb/slice.h" #include "memory_resource.hpp" -#include "records.hpp" #include "result.hpp" -#include "tag_parser.hpp" #include "tasks.hpp" -#include "track.hpp" namespace database { diff --git a/src/tangara/database/env_esp.cpp b/src/tangara/database/env_esp.cpp index f7a5637a..2cf74c3e 100644 --- a/src/tangara/database/env_esp.cpp +++ b/src/tangara/database/env_esp.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "env_esp.hpp" +#include "database/env_esp.hpp" #include #include @@ -41,7 +41,7 @@ namespace leveldb { -tasks::WorkerPool *sBackgroundThread = nullptr; +tasks::WorkerPool* sBackgroundThread = nullptr; std::string ErrToStr(FRESULT err) { switch (err) { diff --git a/src/tangara/database/file_gatherer.cpp b/src/tangara/database/file_gatherer.cpp index b7b7271e..141259c2 100644 --- a/src/tangara/database/file_gatherer.cpp +++ b/src/tangara/database/file_gatherer.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "file_gatherer.hpp" +#include "database/file_gatherer.hpp" #include #include diff --git a/src/tangara/database/file_gatherer.hpp b/src/tangara/database/file_gatherer.hpp index 685bdb2c..38558b9e 100644 --- a/src/tangara/database/file_gatherer.hpp +++ b/src/tangara/database/file_gatherer.hpp @@ -17,20 +17,18 @@ namespace database { class IFileGatherer { public: - virtual ~IFileGatherer(){}; + virtual ~IFileGatherer() {}; virtual auto FindFiles( const std::string& root, - std::function cb) - -> void = 0; + std::function cb) -> void = 0; }; class FileGathererImpl : public IFileGatherer { public: - virtual auto FindFiles( - const std::string& root, - std::function cb) - -> void override; + virtual auto FindFiles(const std::string& root, + std::function + cb) -> void override; }; } // namespace database diff --git a/src/tangara/database/future_fetcher.hpp b/src/tangara/database/future_fetcher.hpp index e8ce9729..a27101f1 100644 --- a/src/tangara/database/future_fetcher.hpp +++ b/src/tangara/database/future_fetcher.hpp @@ -9,7 +9,7 @@ #include #include -#include "database.hpp" +#include "database/database.hpp" namespace database { diff --git a/src/tangara/database/index.cpp b/src/tangara/database/index.cpp index 328c3b43..93a2b1c2 100644 --- a/src/tangara/database/index.cpp +++ b/src/tangara/database/index.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "index.hpp" +#include "database/index.hpp" #include #include @@ -21,8 +21,8 @@ #include "komihash.h" #include "leveldb/write_batch.h" -#include "records.hpp" -#include "track.hpp" +#include "database/records.hpp" +#include "database/track.hpp" namespace database { @@ -183,8 +183,9 @@ auto Indexer::handleItem(const IndexKey::Header& header, } } -auto Index(locale::ICollator& c, const IndexInfo& i, const Track& t) - -> std::vector> { +auto Index(locale::ICollator& c, + const IndexInfo& i, + const Track& t) -> std::vector> { Indexer indexer{c, t, i}; return indexer.index(); } diff --git a/src/tangara/database/index.hpp b/src/tangara/database/index.hpp index 45dae464..8f78439b 100644 --- a/src/tangara/database/index.hpp +++ b/src/tangara/database/index.hpp @@ -17,9 +17,9 @@ #include "leveldb/db.h" #include "leveldb/slice.h" +#include "database/track.hpp" #include "leveldb/write_batch.h" #include "memory_resource.hpp" -#include "track.hpp" namespace database { @@ -61,8 +61,9 @@ struct IndexKey { std::optional track; }; -auto Index(locale::ICollator&, const IndexInfo&, const Track&) - -> std::vector>; +auto Index(locale::ICollator&, + const IndexInfo&, + const Track&) -> std::vector>; auto ExpandHeader(const IndexKey::Header&, const std::optional&) -> IndexKey::Header; diff --git a/src/tangara/database/records.cpp b/src/tangara/database/records.cpp index b086be3b..88ddbd91 100644 --- a/src/tangara/database/records.cpp +++ b/src/tangara/database/records.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "records.hpp" +#include "database/records.hpp" #include #include @@ -21,10 +21,10 @@ #include "cppbor_parse.h" #include "esp_log.h" -#include "index.hpp" +#include "database/index.hpp" +#include "database/track.hpp" #include "komihash.h" #include "memory_resource.hpp" -#include "track.hpp" // As LevelDB is a key-value store, each record in the database consists of a // key and an optional value. diff --git a/src/tangara/database/records.hpp b/src/tangara/database/records.hpp index 3ca68fea..db18fe2f 100644 --- a/src/tangara/database/records.hpp +++ b/src/tangara/database/records.hpp @@ -15,9 +15,9 @@ #include "leveldb/db.h" #include "leveldb/slice.h" -#include "index.hpp" +#include "database/index.hpp" +#include "database/track.hpp" #include "memory_resource.hpp" -#include "track.hpp" namespace database { diff --git a/src/tangara/database/tag_parser.cpp b/src/tangara/database/tag_parser.cpp index cbcbdcb5..86bd6443 100644 --- a/src/tangara/database/tag_parser.cpp +++ b/src/tangara/database/tag_parser.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "tag_parser.hpp" +#include "database/tag_parser.hpp" #include #include diff --git a/src/tangara/database/tag_parser.hpp b/src/tangara/database/tag_parser.hpp index 966258b5..ccbc0ea9 100644 --- a/src/tangara/database/tag_parser.hpp +++ b/src/tangara/database/tag_parser.hpp @@ -8,8 +8,8 @@ #include +#include "database/track.hpp" #include "lru_cache.hpp" -#include "track.hpp" namespace database { diff --git a/src/tangara/database/test/test_database.cpp b/src/tangara/database/test/test_database.cpp index 6aec9bfb..09e19a43 100644 --- a/src/tangara/database/test/test_database.cpp +++ b/src/tangara/database/test/test_database.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "database.hpp" +#include "database/database.hpp" #include #include @@ -13,14 +13,14 @@ #include #include "catch2/catch.hpp" +#include "database/file_gatherer.hpp" +#include "database/tag_parser.hpp" +#include "database/track.hpp" #include "driver_cache.hpp" #include "esp_log.h" -#include "file_gatherer.hpp" #include "i2c_fixture.hpp" #include "leveldb/db.h" #include "spi_fixture.hpp" -#include "tag_parser.hpp" -#include "track.hpp" namespace database { @@ -28,8 +28,8 @@ class TestBackends : public IFileGatherer, public ITagParser { public: std::map tracks; - auto MakeTrack(const std::pmr::string& path, const std::pmr::string& title) - -> void { + auto MakeTrack(const std::pmr::string& path, + const std::pmr::string& title) -> void { TrackTags tags; tags.encoding = Encoding::kMp3; tags.title = title; @@ -44,8 +44,8 @@ class TestBackends : public IFileGatherer, public ITagParser { } } - auto ReadAndParseTags(const std::pmr::string& path, TrackTags* out) - -> bool override { + auto ReadAndParseTags(const std::pmr::string& path, + TrackTags* out) -> bool override { if (tracks.contains(path)) { *out = tracks.at(path); return true; diff --git a/src/tangara/database/test/test_records.cpp b/src/tangara/database/test/test_records.cpp index 2f59489c..f8eb980f 100644 --- a/src/tangara/database/test/test_records.cpp +++ b/src/tangara/database/test/test_records.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "records.hpp" +#include "database/records.hpp" #include #include diff --git a/src/tangara/database/track.cpp b/src/tangara/database/track.cpp index 1b1442a1..5bf8c3e2 100644 --- a/src/tangara/database/track.cpp +++ b/src/tangara/database/track.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-only */ -#include "track.hpp" +#include "database/track.hpp" #include #include -- cgit v1.2.3