From fc95337bb77fcada938639f3b7ea5e6a3df2b6d5 Mon Sep 17 00:00:00 2001 From: Simon Quigley Date: Sun, 15 Dec 2024 03:19:41 -0600 Subject: [PATCH] s/source/source_package_publishing_history/g --- CMakeLists.txt | 4 ++-- src/archive.cpp | 6 +++--- src/archive.h | 4 ++-- src/launchpad.h | 12 ++++++------ ...cpp => source_package_publishing_history.cpp} | 16 ++++++++-------- ...rce.h => source_package_publishing_history.h} | 14 +++++++------- 6 files changed, 28 insertions(+), 28 deletions(-) rename src/{source.cpp => source_package_publishing_history.cpp} (81%) rename src/{source.h => source_package_publishing_history.h} (77%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57812b0..fb2a450 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(launchpad SHARED src/person.cpp src/distribution.cpp src/authentication.cpp - src/source.cpp + src/source_package_publishing_history.cpp src/build.cpp ) @@ -32,7 +32,7 @@ target_compile_definitions(launchpad PRIVATE BUILDING_LAUNCHPAD) set_target_properties(launchpad PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION 0 - PUBLIC_HEADER "src/launchpad.h;src/callablewrapper.h;src/archive.h;src/utils.h;src/person.h;src/distribution.h;src/authentication.h;src/source.h;src/build.h" + PUBLIC_HEADER "src/launchpad.h;src/callablewrapper.h;src/archive.h;src/utils.h;src/person.h;src/distribution.h;src/authentication.h;src/source_package_publishing_history.h;src/build.h" CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN YES ) diff --git a/src/archive.cpp b/src/archive.cpp index 9fb71b6..405ea02 100644 --- a/src/archive.cpp +++ b/src/archive.cpp @@ -16,7 +16,7 @@ #include "archive.h" #include "utils.h" #include "launchpad.h" -#include "source.h" +#include "source_package_publishing_history.h" #include #include @@ -131,7 +131,7 @@ std::string archive::build_archive_endpoint() const { return "~" + url_encode(owner_name) + "/" + url_encode(ppa_name); } -std::generator archive::getPublishedSources(const std::string& status) const { +std::generator archive::getPublishedSources(const std::string& status) const { std::map params; params["ws.op"] = "getPublishedSources"; params["status"] = status; @@ -142,7 +142,7 @@ std::generator archive::getPublishedSources(const std::string& status) c try { if (data.contains("entries") && data["entries"].is_array()) { for (auto& entry : data["entries"]) { - std::optional s_opt = source::parse(entry.dump()); + auto s_opt = source_package_publishing_history::parse(entry.dump()); if (!s_opt) continue; s_opt->set_lp(lp); co_yield s_opt.value(); diff --git a/src/archive.h b/src/archive.h index 2388e88..90f7828 100644 --- a/src/archive.h +++ b/src/archive.h @@ -16,7 +16,7 @@ #ifndef ARCHIVE_H #define ARCHIVE_H -#include "source.h" +#include "source_package_publishing_history.h" #include #include #include @@ -77,7 +77,7 @@ public: std::string web_link; // Public functions - std::generator getPublishedSources(const std::string& status) const; + std::generator getPublishedSources(const std::string& status) const; launchpad* lp; diff --git a/src/launchpad.h b/src/launchpad.h index 99a6189..90eb0f0 100644 --- a/src/launchpad.h +++ b/src/launchpad.h @@ -27,7 +27,7 @@ class distribution; class person; class archive; -class source; +class source_package_publishing_history; class build; #ifndef LAUNCHPAD_API @@ -95,11 +95,11 @@ private: std::optional get_distribution(const std::string& name_); std::optional get_person(const std::string& name_); - friend class person; // so person can call api_* - friend class distribution; // so distribution can call api_* - friend class archive; // so archive can call api_* - friend class source; // so source can call api_* - friend class build; // so build can call api_* + friend class person; // so person can call api_* + friend class distribution; // so distribution can call api_* + friend class archive; // so archive can call api_* + friend class source_package_publishing_history; // so source can call api_* + friend class build; // so build can call api_* }; #endif // LAUNCHPAD_H diff --git a/src/source.cpp b/src/source_package_publishing_history.cpp similarity index 81% rename from src/source.cpp rename to src/source_package_publishing_history.cpp index 244d160..29ea1e2 100644 --- a/src/source.cpp +++ b/src/source_package_publishing_history.cpp @@ -13,25 +13,25 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#include "source.h" +#include "source_package_publishing_history.h" #include "utils.h" #include "build.h" #include "launchpad.h" #include #include -source::source() +source_package_publishing_history::source_package_publishing_history() : source_package_name(""), source_package_version(""), self_link(""), lp(nullptr) {} -source::~source() {} +source_package_publishing_history::~source_package_publishing_history() {} -std::optional source::parse(const std::string& json_data) { - source s; +std::optional source_package_publishing_history::parse(const std::string& json_data) { + source_package_publishing_history s; s.parse_json(json_data); return s; } -void source::parse_json(const std::string& json_data) { +void source_package_publishing_history::parse_json(const std::string& json_data) { try { auto data = nlohmann::json::parse(json_data); @@ -51,7 +51,7 @@ void source::parse_json(const std::string& json_data) { } } -std::vector source::getBuilds() const { +std::vector source_package_publishing_history::getBuilds() const { std::vector builds; if (self_link.empty()) { return builds; } @@ -76,6 +76,6 @@ std::vector source::getBuilds() const { return builds; } -void source::set_lp(launchpad* lp_ptr) { +void source_package_publishing_history::set_lp(launchpad* lp_ptr) { lp = lp_ptr; } diff --git a/src/source.h b/src/source_package_publishing_history.h similarity index 77% rename from src/source.h rename to src/source_package_publishing_history.h index 3573229..b4dac76 100644 --- a/src/source.h +++ b/src/source_package_publishing_history.h @@ -13,8 +13,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#ifndef SOURCE_H -#define SOURCE_H +#ifndef SOURCE_PACKAGE_PUBLISHING_HISTORY +#define SOURCE_PACKAGE_PUBLISHING_HISTORY #include #include @@ -31,13 +31,13 @@ class launchpad; #endif #endif -class LAUNCHPAD_API source { +class LAUNCHPAD_API source_package_publishing_history { public: - source(); - ~source(); + source_package_publishing_history(); + ~source_package_publishing_history(); // Add static parse method declaration - static std::optional parse(const std::string& json_data); + static std::optional parse(const std::string& json_data); void parse_json(const std::string& json_data); std::vector getBuilds() const; @@ -52,4 +52,4 @@ private: launchpad* lp; }; -#endif // SOURCE_H +#endif // SOURCE_PACKAGE_PUBLISHING_HISTORY