|
|
|
@ -13,25 +13,25 @@
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
#include "source.h"
|
|
|
|
|
#include "source_package_publishing_history.h"
|
|
|
|
|
#include "utils.h"
|
|
|
|
|
#include "build.h"
|
|
|
|
|
#include "launchpad.h"
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <nlohmann/json.hpp>
|
|
|
|
|
|
|
|
|
|
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> source::parse(const std::string& json_data) {
|
|
|
|
|
source s;
|
|
|
|
|
std::optional<source_package_publishing_history> 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<build> source::getBuilds() const {
|
|
|
|
|
std::vector<build> source_package_publishing_history::getBuilds() const {
|
|
|
|
|
std::vector<build> builds;
|
|
|
|
|
if (self_link.empty()) { return builds; }
|
|
|
|
|
|
|
|
|
@ -76,6 +76,6 @@ std::vector<build> 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;
|
|
|
|
|
}
|