2016-09-19 11:50:08 +08:00
|
|
|
#pragma once
|
|
|
|
#include "StatusParagraph.h"
|
|
|
|
#include <memory>
|
2017-01-27 09:52:54 +08:00
|
|
|
#include <iterator>
|
2016-09-19 11:50:08 +08:00
|
|
|
|
|
|
|
namespace vcpkg
|
|
|
|
{
|
|
|
|
struct StatusParagraphs
|
|
|
|
{
|
|
|
|
StatusParagraphs();
|
|
|
|
explicit StatusParagraphs(std::vector<std::unique_ptr<StatusParagraph>>&& ps);
|
|
|
|
|
|
|
|
using container = std::vector<std::unique_ptr<StatusParagraph>>;
|
|
|
|
using iterator = container::reverse_iterator;
|
|
|
|
using const_iterator = container::const_reverse_iterator;
|
|
|
|
|
2017-04-04 05:45:00 +08:00
|
|
|
const_iterator find(const PackageSpec& spec) const
|
2016-11-16 03:56:46 +08:00
|
|
|
{
|
|
|
|
return find(spec.name(), spec.target_triplet());
|
|
|
|
}
|
2017-04-04 06:02:45 +08:00
|
|
|
const_iterator find(const std::string& name, const Triplet& target_triplet) const;
|
|
|
|
iterator find(const std::string& name, const Triplet& target_triplet);
|
2017-04-08 05:42:19 +08:00
|
|
|
|
|
|
|
const_iterator find_installed(const PackageSpec& spec) const
|
|
|
|
{
|
|
|
|
return find_installed(spec.name(), spec.target_triplet());
|
|
|
|
}
|
2017-04-04 06:02:45 +08:00
|
|
|
const_iterator find_installed(const std::string& name, const Triplet& target_triplet) const;
|
2016-09-19 11:50:08 +08:00
|
|
|
|
|
|
|
iterator insert(std::unique_ptr<StatusParagraph>);
|
|
|
|
|
|
|
|
friend std::ostream& operator<<(std::ostream&, const StatusParagraphs&);
|
|
|
|
|
2017-01-27 09:52:54 +08:00
|
|
|
iterator end()
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
return paragraphs.rend();
|
|
|
|
}
|
|
|
|
|
2017-01-27 09:52:54 +08:00
|
|
|
const_iterator end() const
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
return paragraphs.rend();
|
|
|
|
}
|
|
|
|
|
2017-01-27 09:52:54 +08:00
|
|
|
iterator begin()
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
return paragraphs.rbegin();
|
|
|
|
}
|
|
|
|
|
2017-01-27 09:52:54 +08:00
|
|
|
const_iterator begin() const
|
2016-09-19 11:50:08 +08:00
|
|
|
{
|
|
|
|
return paragraphs.rbegin();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::vector<std::unique_ptr<StatusParagraph>> paragraphs;
|
|
|
|
};
|
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream&, const StatusParagraphs&);
|
|
|
|
}
|