2025-03-10 12:16:31 +01:00
|
|
|
/*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
*/
|
2025-03-12 13:04:58 +01:00
|
|
|
#include "katja/repository.hpp"
|
|
|
|
|
2025-03-10 12:16:31 +01:00
|
|
|
namespace katja
|
|
|
|
{
|
2025-03-12 13:04:58 +01:00
|
|
|
std::string package_identifier::to_string() const
|
|
|
|
{
|
|
|
|
std::string identifier;
|
|
|
|
const std::size_t total_size = this->name.size() + this->version.size()
|
|
|
|
+ this->architecture.size() + this->data.size() + 3;
|
|
|
|
|
|
|
|
identifier.reserve(total_size);
|
|
|
|
identifier.append(this->name);
|
|
|
|
identifier.push_back(';');
|
|
|
|
identifier.append(this->version);
|
|
|
|
identifier.push_back(';');
|
|
|
|
identifier.append(this->architecture);
|
|
|
|
identifier.push_back(';');
|
|
|
|
identifier.append(this->data);
|
|
|
|
|
|
|
|
return identifier;
|
|
|
|
}
|
2025-03-10 12:16:31 +01:00
|
|
|
}
|