File: results.cc

package info (click to toggle)
c%2B%2B-annotations 13.02.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 13,576 kB
  • sloc: cpp: 25,297; makefile: 1,523; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (47 lines) | stat: -rw-r--r-- 1,179 bytes parent folder | download | duplicates (3)
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
#include "main.ih"

//code
void results()
{
    g_out.seekg(0);

    int value;
    string line;
    string errorDisplay;

    while (g_out >> value >> line)      // process g_out's content
    {
        g_out.ignore(100, '\n');

        if (value == 0)                 // no error: show the source file
        {
            cerr << line << '\n';
            continue;
        }
                                        // at compilation errors:
        if (not errorDisplay.empty())   // after the 1st error: skip
        {
            do
            {
                getline(g_out, line);
            }
            while (line != g_marker);

            continue;
        }
                                        // first compilation error:
        errorDisplay = line + '\n';     // keep the the name of the source
        while (true)                    // and its error messages
        {
            getline(g_out, line);

            if (line == g_marker)
                break;

            errorDisplay += line + '\n';
        }
    }

    cerr << errorDisplay;               // eventually insert the error-info
}                                       // (if any)
//=