Skip to content
Snippets Groups Projects
Commit 9c04f311 authored by Mark Olesen's avatar Mark Olesen
Browse files

The #remove directive can now take a wordRe type

parent e38822ad
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,7 @@ License ...@@ -26,6 +26,7 @@ License
#include "removeEntry.H" #include "removeEntry.H"
#include "dictionary.H" #include "dictionary.H"
#include "stringListOps.H"
#include "IStringStream.H" #include "IStringStream.H"
#include "OStringStream.H" #include "OStringStream.H"
#include "addToMemberFunctionSelectionTable.H" #include "addToMemberFunctionSelectionTable.H"
...@@ -64,22 +65,12 @@ bool Foam::functionEntries::removeEntry::execute ...@@ -64,22 +65,12 @@ bool Foam::functionEntries::removeEntry::execute
Istream& is Istream& is
) )
{ {
token currToken(is); wordList dictKeys = parentDict.toc();
is.putBack(currToken); labelList indices = findStrings<word>(readList<wordRe>(is), dictKeys);
if (currToken == token::BEGIN_LIST) forAll(indices, indexI)
{ {
wordList keys(is); parentDict.remove(dictKeys[indices[indexI]]);
forAll(keys, keyI)
{
parentDict.remove(keys[keyI]);
}
}
else
{
word key(is);
parentDict.remove(key);
} }
return true; return true;
......
...@@ -28,13 +28,16 @@ Class ...@@ -28,13 +28,16 @@ Class
Description Description
Remove a dictionary entry. Remove a dictionary entry.
The @c \#remove directive takes a word or a list of words. For example, The @c \#remove directive takes a list or a single wordRe.
For example,
@verbatim @verbatim
#remove entry0 #remove entry0
#remove ( entry1 entry2 entry3 ) #remove ( entry1 entry2 entry3 otherEntry )
#remove "entry[1-3]"
#remove ( "entry[1-3]" otherEntry )
@endverbatim @endverbatim
The removable only occurs in the current context. The removal only occurs in the current context.
Removing sub-entries or parent entries is not supported. Removing sub-entries or parent entries is not supported.
SourceFiles SourceFiles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment