I am currently working on a program that reads through an XML file and picks out the opening tags and closing tags. I am pushing the element tag name onto a stack only if the elements closing tag is not on the same line.
I have a class called 'Parser' which parses the XML file to pick out the elements. I also have multiple objects that are part of the class. When using the objects in my .cpp file I am getting the following error... "error:'Parser' does not name a type."
if (openStartBracket != string::npos) {
if (line[openStartBracket + 1] == '!') {
size_t const closingCommentBracket = line.find("-->", 0);
if (closingCommentBracket != string::npos) {
size_t start = line.find("<!--", 0) + 4; //searches to see if opening comment tag located (code from Stephanie))
size_t end = line.find("-->", start); //searches to see if closing comment tag located (code from Stephanie)
elementTagName = "";
content = line.substr(start, end - start);
return ONE_LINE_COMMENT;
} else {
size_t start = line.find("<!--", 0) + 4;
size_t end = line.length();
elementTagName = "";
content = line.substr(start, end - start);
return STARTING_COMMENT;
}