shell/Wildcard.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int simpleWildcardFind (const string &path, vector< ObjId > &ret)
int wildcardFind (const string &n, vector< ObjId > &ret)
int allChildren (ObjId start, unsigned int index, const string &insideBrace, vector< ObjId > &ret)

Function Documentation

int allChildren ( ObjId  start,
unsigned int  index,
const string &  insideBrace,
vector< ObjId > &  ret 
)

Recursive function to compare all descendants and cram matches into ret. Returns number of matches. Index is either ALLDATA == ~0U, or a specified number. insideBrace is a string that can be empty, or specify one of the expressions: [TYPE==<string>] [TYPE=<string>] [CLASS=<string>] [ISA=<string>] [ISA==<string>] [TYPE!=<string>] [CLASS!=<string>] [ISA!=<string>] [FIELD(<fieldName)=<string>]

int simpleWildcardFind ( const string &  path,
vector< ObjId > &  ret 
)

simpleWildcardFind returns the number of Ids found. This is the basic wildcardFind function, working on a single tree. It adds entries into the vector 'ret' with Ids found according to the path string. It preserves the order of the returned Ids as the order of elements traversed in the search. It does NOT eliminate duplicates. This is a depth-first search. Note that it does NOT list every entry in arrays, only the base Element.

Wildcard search rules are like this:

  • Multiple wildcard paths can be specified, separated by commas
  • Each wildcard path looks like a file path, separated by '/'
  • At each level of the wildcard path, we have element specifiers.
  • Each specifier can be a single fully specified element, or a wildcard.
  • Substrings of the specifier can be wildcarded with '#'
    • The entire specifier can also be a '#'
  • Characters of the specifier can be wildcarded with '?'
  • An entire recursive tree can be specified using '##'
  • As a qualifier to any of the wildcard specifiers we can use expressions enclosed in square brackets. These expressions are of the form: [TYPE==<string>] [TYPE=<string>] [CLASS=<string>] [ISA=<string>] [ISA==<string>] [TYPE!=<string>] [CLASS!=<string>] [ISA!=<string>] [FIELD(<fieldName)=<string>]
int wildcardFind ( const string &  n,
vector< ObjId > &  ret 
)

wildcardFind returns the number of Ids found. This behaves the same as simpleWildcardFind, except that it eliminates non-unique entries, and in the process will scramble the ordering.


Generated on 1 Jul 2015 for MOOSE by  doxygen 1.6.1