summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorljfa-ag <ljfa-ag@web.de>2015-07-12 12:48:08 +0200
committerljfa-ag <ljfa-ag@web.de>2015-07-12 12:48:08 +0200
commit3c1177618ad70760bfb315c930065054f8aefedd (patch)
tree388344b3a548bd54ad4ed20bc46cd3e11a4e7f8a /include
parentbd8ac94ccb071ffb4cc16b3fb514e789ca1f866d (diff)
downloadProject-Tick-3c1177618ad70760bfb315c930065054f8aefedd.tar.gz
Project-Tick-3c1177618ad70760bfb315c930065054f8aefedd.zip
Add functions for the list's content type
Diffstat (limited to 'include')
-rw-r--r--include/tag_list.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/tag_list.h b/include/tag_list.h
index afc04c0616..b13da3c5a9 100644
--- a/include/tag_list.h
+++ b/include/tag_list.h
@@ -37,8 +37,15 @@ public:
///The type of the tag
static constexpr tag_type type = tag_type::List;
- ///Constructs an empty list
- tag_list() {}
+ /**
+ * @brief Constructs an empty list
+ *
+ * The content type is determined when the first tag is added.
+ */
+ tag_list();
+
+ ///Constructs an empty list with the given content type
+ tag_list(tag_type type);
/**
* @brief Accesses a tag by index with bounds checking
@@ -77,6 +84,9 @@ public:
///Removes the last element of the list
void pop_back();
+ ///Returns the content type of the list, or tag_type::Null if undetermined
+ tag_type el_type() const;
+
///Returns the number of tags in the list
size_t size() const;
@@ -96,6 +106,7 @@ public:
private:
std::vector<value> tags;
+ tag_type el_type;
};
}