CmdTags: Implemented 'tags' command

This commit is contained in:
Paul Beckingham 2016-03-22 21:40:49 -04:00
parent 5710800d0f
commit 3c0dc76694

View file

@ -26,25 +26,26 @@
#include <cmake.h> #include <cmake.h>
#include <commands.h> #include <commands.h>
#include <algorithm>
#include <iostream> #include <iostream>
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int CmdTags (Database& database, Log& log) int CmdTags (Database& database, Log& log)
{ {
std::cout << "[tags: enumerate tags in use]\n"; // Generate a unique, ordered list of tags.
std::vector <std::string> tags;
// TODO Enumerate all data files. for (auto& interval : database.getAllIntervals ())
// TODO For each data file. for (auto& tag : interval.tags ())
// TODO For each inclusion. if (std::find (tags.begin (), tags.end (), tag) == tags.end ())
// TODO Extract tags. tags.push_back (tag);
// TODO Add tags to unique set.
// TODO Determine sort order - most recent first? // TODO Determine sort order - most recent first?
// TODO Determine sort order - most common first? // TODO Determine sort order - most common first?
// TODO For each tag in set. // Shows all tags.
// TODO Load metadata. // TODO Show all tag metadata.
// TODO Display. for (auto& tag : tags)
std::cout << tag << "\n";
return 0; return 0;
} }