MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / EnumPredefinedVariables

Method EnumPredefinedVariables

src/fs/fsparserutil.cpp:203–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool cFSParserUtil::EnumPredefinedVariables(int index, TSTRING& sName, TSTRING& sValue) const
204{
205 switch (index)
206 {
207 case 0:
208 sName = TSS_GetString(cFS, fs::STR_PARSER_READONLY);
209 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_READONLY_VAL);
210 return true;
211 case 1:
212 sName = TSS_GetString(cFS, fs::STR_PARSER_DYNAMIC);
213 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_DYNAMIC_VAL);
214 return true;
215 case 2:
216 sName = TSS_GetString(cFS, fs::STR_PARSER_GROWING);
217 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_GROWING_VAL);
218 return true;
219 case 3:
220 sName = TSS_GetString(cFS, fs::STR_PARSER_IGNOREALL);
221 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_IGNOREALL_VAL);
222 return true;
223 case 4:
224 sName = TSS_GetString(cFS, fs::STR_PARSER_IGNORENONE);
225 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_IGNORENONE_VAL);
226 return true;
227 case 5:
228 sName = TSS_GetString(cFS, fs::STR_PARSER_DEVICE);
229 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_DEVICE_VAL);
230 return true;
231 case 6:
232 sName = TSS_GetString(cFS, fs::STR_PARSER_HOSTNAME);
233 try
234 {
235 iFSServices::GetInstance()->GetMachineName(sValue);
236 if (sValue.empty())
237 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_HOSTNAME_VAL);
238 }
239 catch (eFSServices&)
240 {
241 sValue = TSS_GetString(cFS, fs::STR_FS_PARSER_HOSTNAME_VAL);
242 }
243 return true;
244 default:
245 return false;
246 }
247
248 ASSERT(false); // unreachable code
249}
250
251bool cFSParserUtil::IsAbsolutePath(const TSTRING& strPath) const
252{

Callers 1

Calls 2

GetMachineNameMethod · 0.80
emptyMethod · 0.80

Tested by

no test coverage detected