MCPcopy Create free account
hub / github.com/Kitware/CMake / Process

Method Process

Source/cmVisualStudioSlnParser.cxx:190–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190bool cmVisualStudioSlnParser::State::Process(
191 cmVisualStudioSlnParser::ParsedLine const& line, cmSlnData& output,
192 cmVisualStudioSlnParser::ResultData& result)
193{
194 assert(!line.IsComment());
195 switch (this->Stack.top()) {
196 case FileStateStart:
197 if (!cmHasLiteralPrefix(line.GetTag(),
198 "Microsoft Visual Studio Solution File")) {
199 result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
200 return false;
201 }
202 this->Stack.pop();
203 this->Stack.push(FileStateTopLevel);
204 break;
205 case FileStateTopLevel:
206 if (line.GetTag() == "Project"_s) {
207 if (line.GetValueCount() != 3) {
208 result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
209 return false;
210 }
211 if (this->RequestedData.test(DataGroupProjectsBit)) {
212 if (!output.AddProject(line.GetValue(2), line.GetValue(0),
213 line.GetValue(1))) {
214 result.SetError(ResultErrorInputData, this->GetCurrentLine());
215 return false;
216 }
217 this->Stack.push(FileStateProject);
218 } else {
219 this->IgnoreUntilTag("EndProject");
220 }
221 } else if (line.GetTag() == "Global"_s) {
222
223 this->Stack.push(FileStateGlobal);
224 } else if (line.GetTag() == "VisualStudioVersion"_s) {
225 output.SetVisualStudioVersion(line.GetValue(0));
226 } else if (line.GetTag() == "MinimumVisualStudioVersion"_s) {
227 output.SetMinimumVisualStudioVersion(line.GetValue(0));
228 } else {
229 result.SetError(ResultErrorInputStructure, this->GetCurrentLine());
230 return false;
231 }
232 break;
233 case FileStateProject:
234 if (line.GetTag() == "EndProject"_s) {
235 this->Stack.pop();
236 } else if (line.GetTag() == "ProjectSection"_s) {
237 if (line.GetArg() == "ProjectDependencies"_s &&
238 line.GetValue(0) == "postProject"_s) {
239 if (this->RequestedData.test(DataGroupProjectDependenciesBit)) {
240 this->Stack.push(FileStateProjectDependencies);
241 } else {
242 this->IgnoreUntilTag("EndProjectSection");
243 }
244 } else {
245 this->IgnoreUntilTag("EndProjectSection");
246 }
247 } else {

Callers 1

ParseImplMethod · 0.45

Calls 15

IgnoreUntilTagMethod · 0.95
cmHasLiteralPrefixFunction · 0.85
IsCommentMethod · 0.80
GetCurrentLineMethod · 0.80
GetValueCountMethod · 0.80
IsKeyValuePairMethod · 0.80
GetProjectByGUIDMethod · 0.80
SetErrorMethod · 0.45
AddProjectMethod · 0.45

Tested by

no test coverage detected