/**
* Reads in a tag and assigns it to a tag.
* @param in, input stream going into operator.
* @param rtVal, tag to be sent through the operator.
* @return istream.
*/
istream &operator>>(istream &in, Tag &rtVal) {
// Variables //
Tag compare;
string tname = "";
string cname = "";
char c;
bool done;
TagStack stack;
rtVal.setName(tname);
// Process Characters //
while (in.peek() != EOF && in.peek() != '<') {
c = in.get();
}
if (!in.eof()) {
in.get();
// Found Ending Tag //
if (in.peek() != EOF && in.peek() == '/') {
// read a token as a name & skip white space until character is found
done = false;
while (!done) {
if (in.peek() == EOF)
done = true;
else {
c = in.get();
if (isspace(c)) {
} else {
done = true;
tname += c;
rtVal.setName(tname);
}
}
}
}
rtVal.setBegin(false);
// If Ending Tag Name Matches //
if (rtVal.getName() == compare.getName()) {
stack.pop();
}
// Found Starting Tag //
} elseif (in.peek.() != EOF && in.peek() == '<') {
// read a token as a name & skip white space until character is found
done = false;
while (!done) {
if (in.peek() == EOF)
done = true;
else {
c = in.get();
if (isspace(c)) {
} else {
done = true;
tname += c;
rtVal.setName(tname);
}
}
}
}
// Push Starting Tag On Stack //
rtVal.setBegin(true);
stack.push(rtVal);
return in;
}
on line 47 netbeans gives me these two errors
βin->std::basic_istream<_CharT, _Traits>::peek [with _CharT = char, _Traits = std::char_traits<char>]β does not have class type