Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Static Private Attributes
inputModeEntry Class Reference

Specify the input mode when reading dictionaries, expects a single word to follow. More...

Inheritance diagram for inputModeEntry:
Inheritance graph
[legend]
Collaboration diagram for inputModeEntry:
Collaboration graph
[legend]

Public Member Functions

 ClassName ("inputMode")
 Runtime type information. More...
 
- Public Member Functions inherited from functionEntry
 declareMemberFunctionSelectionTable (bool, functionEntry, execute, dictionaryIstream,(dictionary &parentDict, Istream &is),(parentDict, is))
 
 declareMemberFunctionSelectionTable (bool, functionEntry, execute, primitiveEntryIstream,(const dictionary &parentDict, primitiveEntry &entry, Istream &is),(parentDict, entry, is))
 

Static Public Member Functions

static bool execute (dictionary &parentDict, Istream &)
 Execute the functionEntry in a sub-dict context. More...
 
static void clear ()
 Reset the inputMode to default (ie, merge) More...
 
static bool merge ()
 Return true if the inputMode is merge. More...
 
static bool overwrite ()
 Return true if the inputMode is overwrite. More...
 
static bool protect ()
 Return true if the inputMode is protect. More...
 
static bool error ()
 Return true if the inputMode is error. More...
 
- Static Public Member Functions inherited from functionEntry
static bool execute (const word &functionName, dictionary &parentDict, Istream &)
 Execute the functionEntry in a sub-dict context. More...
 
static bool execute (const word &functionName, const dictionary &parentDict, primitiveEntry &, Istream &)
 Execute the functionEntry in a primitiveEntry context. More...
 

Private Types

enum  inputMode {
  MERGE, OVERWRITE, PROTECT, WARN,
  ERROR
}
 The input mode options. More...
 

Private Member Functions

 inputModeEntry (const inputModeEntry &)
 Disallow default bitwise copy construct. More...
 
void operator= (const inputModeEntry &)
 Disallow default bitwise assignment. More...
 

Static Private Member Functions

static void setMode (Istream &)
 Read the mode as a word and set enum appropriately. More...
 

Static Private Attributes

static inputMode mode_
 The current input mode. More...
 

Detailed Description

Specify the input mode when reading dictionaries, expects a single word to follow.

An example of #inputMode directive:

    #inputMode merge

The possible input modes:

Parameters
mergemerge sub-dictionaries when possible
overwritekeep last entry and silently remove previous ones
protectkeep initial entry and silently ignore subsequent ones
warnkeep initial entry and warn about subsequent ones
errorissue a FatalError for duplicate entries
defaultcurrently identical to merge
Source files

Definition at line 64 of file inputModeEntry.H.

Member Enumeration Documentation

◆ inputMode

enum inputMode
private

The input mode options.

Enumerator
MERGE 
OVERWRITE 
PROTECT 
WARN 
ERROR 

Definition at line 69 of file inputModeEntry.H.

Constructor & Destructor Documentation

◆ inputModeEntry()

inputModeEntry ( const inputModeEntry )
private

Disallow default bitwise copy construct.

Member Function Documentation

◆ setMode()

void setMode ( Istream is)
staticprivate

Read the mode as a word and set enum appropriately.

Definition at line 61 of file inputModeEntry.C.

References inputModeEntry::clear(), Foam::endl(), inputModeEntry::ERROR, inputModeEntry::MERGE, Foam::mode(), inputModeEntry::mode_, inputModeEntry::OVERWRITE, inputModeEntry::PROTECT, inputModeEntry::WARN, and WarningInFunction.

Here is the call graph for this function:

◆ operator=()

void operator= ( const inputModeEntry )
private

Disallow default bitwise assignment.

◆ ClassName()

ClassName ( "inputMode"  )

Runtime type information.

◆ execute()

bool execute ( dictionary parentDict,
Istream is 
)
static

Execute the functionEntry in a sub-dict context.

Definition at line 99 of file inputModeEntry.C.

◆ clear()

void clear ( )
static

Reset the inputMode to default (ie, merge)

Definition at line 109 of file inputModeEntry.C.

Referenced by dictionary::dictionary(), Foam::operator>>(), and inputModeEntry::setMode().

Here is the caller graph for this function:

◆ merge()

bool merge ( )
static

Return true if the inputMode is merge.

Definition at line 115 of file inputModeEntry.C.

Referenced by entry::New().

Here is the caller graph for this function:

◆ overwrite()

bool overwrite ( )
static

Return true if the inputMode is overwrite.

Definition at line 121 of file inputModeEntry.C.

Referenced by entry::New().

Here is the caller graph for this function:

◆ protect()

bool protect ( )
static

Return true if the inputMode is protect.

Definition at line 127 of file inputModeEntry.C.

Referenced by entry::New().

Here is the caller graph for this function:

◆ error()

bool error ( )
static

Return true if the inputMode is error.

Definition at line 132 of file inputModeEntry.C.

Referenced by entry::New().

Here is the caller graph for this function:

Field Documentation

◆ mode_

The current input mode.

Definition at line 79 of file inputModeEntry.H.

Referenced by inputModeEntry::setMode().


The documentation for this class was generated from the following files: