operator>>

I am writing a simple xml validator as an assignment. I ame having an issue with reading in the file with my operator>> here is the code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
 * 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 //
    } else 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);
                }
            }
        }
    }
    // 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

expected unqualified-id before β€˜(’ token

any ideas, Thanks in advance
Remove the . between the peek and the ().
really that is there i cant belive i didnt see it thanks
Topic archived. No new replies allowed.