summaryrefslogtreecommitdiffstats
path: root/src/bookmarks.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/bookmarks.hh')
-rw-r--r--src/bookmarks.hh36
1 files changed, 34 insertions, 2 deletions
diff --git a/src/bookmarks.hh b/src/bookmarks.hh
index 189e830..c8ffa56 100644
--- a/src/bookmarks.hh
+++ b/src/bookmarks.hh
@@ -34,24 +34,56 @@
#include <algorithm>
#include <map>
-#include <unordered_set>
#include <string>
+#include <unordered_set>
#include <vector>
#include "base/lnav_log.hh"
+struct logmsg_annotations {
+ std::map<std::string, std::string> la_pairs;
+};
+
struct bookmark_metadata {
static std::unordered_set<std::string> KNOWN_TAGS;
+ enum class categories : int {
+ any = 0,
+ partition = 0x01,
+ notes = 0x02,
+ };
+
+ bool has(categories props) const
+ {
+ if (props == categories::any) {
+ return true;
+ }
+
+ if (props == categories::partition && !this->bm_name.empty()) {
+ return true;
+ }
+
+ if (props == categories::notes
+ && (!this->bm_comment.empty()
+ || !this->bm_annotations.la_pairs.empty()
+ || !this->bm_tags.empty()))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
std::string bm_name;
std::string bm_comment;
+ logmsg_annotations bm_annotations;
std::vector<std::string> bm_tags;
void add_tag(const std::string& tag);
bool remove_tag(const std::string& tag);
- bool empty() const;
+ bool empty(categories props) const;
void clear();
};