ENH: add REMOVE_DUPLICATES subcommand to LIST command (and test). Remove duplicates from a list (keep the ordering)

This commit is contained in:
Sebastien Barre
2008-03-12 17:02:10 -04:00
parent 2ad4f4bb9d
commit f64d3d0b77
3 changed files with 73 additions and 0 deletions
+3
View File
@@ -73,6 +73,7 @@ public:
" list(INSERT <list> <element_index> <element> [<element> ...])\n"
" list(REMOVE_ITEM <list> <value> [<value> ...])\n"
" list(REMOVE_AT <list> <index> [<index> ...])\n"
" list(REMOVE_DUPLICATES <list>)\n"
" list(REVERSE <list>)\n"
" list(SORT <list>)\n"
"LENGTH will return a given list's length.\n"
@@ -84,6 +85,7 @@ public:
"REMOVE_AT and REMOVE_ITEM will remove items from the list. The "
"difference is that REMOVE_ITEM will remove the given items, while "
"REMOVE_AT will remove the items at the given indices.\n"
"REMOVE_DUPLICATES will remove duplicated items in the list.\n"
"REVERSE reverses the contents of the list in-place.\n"
"SORT sorts the list in-place alphabetically.\n"
"NOTES: A list in cmake is a ; separated group of strings. "
@@ -110,6 +112,7 @@ protected:
bool HandleInsertCommand(std::vector<std::string> const& args);
bool HandleRemoveAtCommand(std::vector<std::string> const& args);
bool HandleRemoveItemCommand(std::vector<std::string> const& args);
bool HandleRemoveDuplicatesCommand(std::vector<std::string> const& args);
bool HandleSortCommand(std::vector<std::string> const& args);
bool HandleReverseCommand(std::vector<std::string> const& args);