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

Method ParseObjectName

src/tw/twutil.cpp:1100–1137  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////////// ParseObjectName //////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

1098// ParseObjectName
1099///////////////////////////////////////////////////////////////////////////////
1100cFCOName cTWUtil::ParseObjectName(const TSTRING& fcoName)
1101{
1102 TW_UNIQUE_PTR<iParserGenreUtil> pParseUtil(iTWFactory::GetInstance()->CreateParserGenreUtil());
1103 cFCOName name(iTWFactory::GetInstance()->GetNameInfo());
1104 //
1105 // make sure the fco name is a full path...
1106 //
1107 if (!pParseUtil->IsAbsolutePath(fcoName))
1108 throw eTWUtilNotFullPath(fcoName);
1109 //
1110 // construct the list that InterpretFCOName needs....
1111 std::list<TSTRING> inputNameList;
1112 //
1113 // dice up the string into a list
1114 // currently, we only slice it up based on "|" (for nt registry entries)
1115 //
1116 TSTRING::size_type pos = fcoName.find_first_of(_T('|'));
1117 if (pos != TSTRING::npos)
1118 {
1119 // if the input string is "foo|bar" then we want the list to
1120 // look like this: "foo", "|", "bar" (three entries)
1121 //
1122 TSTRING str;
1123 str.assign(fcoName, 0, pos);
1124 inputNameList.push_back(str);
1125 inputNameList.push_back(_T("|"));
1126 str.assign(fcoName, pos + 1, fcoName.length() - pos);
1127 inputNameList.push_back(str);
1128 }
1129 else
1130 {
1131 inputNameList.push_back(fcoName);
1132 }
1133
1134 pParseUtil->InterpretFCOName(inputNameList, name);
1135
1136 return name;
1137}
1138
1139
1140///////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 6

CreateParserGenreUtilMethod · 0.80
GetNameInfoMethod · 0.80
assignMethod · 0.80
InterpretFCONameMethod · 0.80
IsAbsolutePathMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected