aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include/StatusParagraphs.h
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:50:08 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:54:03 -0700
commitccca198c1b1730b0241911cb56dc8e3504958b2a (patch)
treea2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /toolsrc/include/StatusParagraphs.h
downloadvcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz
vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip
Initial commit
Diffstat (limited to 'toolsrc/include/StatusParagraphs.h')
-rw-r--r--toolsrc/include/StatusParagraphs.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/toolsrc/include/StatusParagraphs.h b/toolsrc/include/StatusParagraphs.h
new file mode 100644
index 000000000..9446d432c
--- /dev/null
+++ b/toolsrc/include/StatusParagraphs.h
@@ -0,0 +1,49 @@
+#pragma once
+#include "StatusParagraph.h"
+#include <memory>
+
+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;
+
+ const_iterator find(const std::string& name, const triplet& target_triplet) const;
+ iterator find(const std::string& name, const triplet& target_triplet);
+ iterator find_installed(const std::string& name, const triplet& target_triplet);
+
+ iterator insert(std::unique_ptr<StatusParagraph>);
+
+ friend std::ostream& operator<<(std::ostream&, const StatusParagraphs&);
+
+ auto end()
+ {
+ return paragraphs.rend();
+ }
+
+ auto end() const
+ {
+ return paragraphs.rend();
+ }
+
+ auto begin()
+ {
+ return paragraphs.rbegin();
+ }
+
+ auto begin() const
+ {
+ return paragraphs.rbegin();
+ }
+
+ private:
+ std::vector<std::unique_ptr<StatusParagraph>> paragraphs;
+ };
+
+ std::ostream& operator<<(std::ostream&, const StatusParagraphs&);
+}