Commit 9c04f311 authored by Mark Olesen's avatar Mark Olesen
Browse files

The #remove directive can now take a wordRe type

parent e38822ad
......@@ -26,6 +26,7 @@ License
#include "removeEntry.H"
#include "dictionary.H"
#include "stringListOps.H"
#include "IStringStream.H"
#include "OStringStream.H"
#include "addToMemberFunctionSelectionTable.H"
......@@ -64,22 +65,12 @@ bool Foam::functionEntries::removeEntry::execute
Istream& is
)
{
token currToken(is);
is.putBack(currToken);
wordList dictKeys = parentDict.toc();
labelList indices = findStrings<word>(readList<wordRe>(is), dictKeys);
if (currToken == token::BEGIN_LIST)
forAll(indices, indexI)
{
wordList keys(is);
forAll(keys, keyI)
{
parentDict.remove(keys[keyI]);
}
}
else
{
word key(is);
parentDict.remove(key);
parentDict.remove(dictKeys[indices[indexI]]);
}
return true;
......
......@@ -28,13 +28,16 @@ Class
Description
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
#remove entry0
#remove ( entry1 entry2 entry3 )
#remove ( entry1 entry2 entry3 otherEntry )
#remove "entry[1-3]"
#remove ( "entry[1-3]" otherEntry )
@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.
SourceFiles
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment