inputModeEntry.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "inputModeEntry.H"
00028 #include "dictionary.H"
00029 #include "addToMemberFunctionSelectionTable.H"
00030
00031
00032
00033 const Foam::word Foam::functionEntries::inputModeEntry::typeName
00034 (
00035 Foam::functionEntries::inputModeEntry::typeName_()
00036 );
00037
00038
00039
00040 int Foam::functionEntries::inputModeEntry::debug(0);
00041
00042 Foam::functionEntries::inputModeEntry::inputMode
00043 Foam::functionEntries::inputModeEntry::mode_(MERGE);
00044
00045 namespace Foam
00046 {
00047 namespace functionEntries
00048 {
00049 addToMemberFunctionSelectionTable
00050 (
00051 functionEntry,
00052 inputModeEntry,
00053 execute,
00054 dictionaryIstream
00055 );
00056 }
00057 }
00058
00059
00060
00061
00062 void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
00063 {
00064 clear();
00065
00066 word mode(is);
00067 if (mode == "merge" || mode == "default")
00068 {
00069 mode_ = MERGE;
00070 }
00071 else if (mode == "overwrite")
00072 {
00073 mode_ = OVERWRITE;
00074 }
00075 else if (mode == "protect")
00076 {
00077 mode_ = PROTECT;
00078 }
00079 else if (mode == "warn")
00080 {
00081 mode_ = WARN;
00082 }
00083 else if (mode == "error")
00084 {
00085 mode_ = ERROR;
00086 }
00087 else
00088 {
00089 WarningIn("Foam::functionEntries::inputModeEntry::setMode(Istream&)")
00090 << "unsupported input mode '" << mode
00091 << "' ... defaulting to 'merge'"
00092 << endl;
00093 }
00094 }
00095
00096
00097
00098
00099 bool Foam::functionEntries::inputModeEntry::execute
00100 (
00101 dictionary& parentDict,
00102 Istream& is
00103 )
00104 {
00105 setMode(is);
00106 return true;
00107 }
00108
00109
00110 void Foam::functionEntries::inputModeEntry::clear()
00111 {
00112 mode_ = MERGE;
00113 }
00114
00115
00116 bool Foam::functionEntries::inputModeEntry::merge()
00117 {
00118 return mode_ == MERGE;
00119 }
00120
00121
00122 bool Foam::functionEntries::inputModeEntry::overwrite()
00123 {
00124 return mode_ == OVERWRITE;
00125 }
00126
00127
00128 bool Foam::functionEntries::inputModeEntry::protect()
00129 {
00130 return mode_ == PROTECT;
00131 }
00132
00133 bool Foam::functionEntries::inputModeEntry::error()
00134 {
00135 return mode_ == ERROR;
00136 }
00137
00138
00139
Copyright © 2000-2009 OpenCFD Ltd