File: complete.cc

package info (click to toggle)
guncat 2.02.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 524 kB
  • sloc: cpp: 1,076; makefile: 105; sh: 37; ansic: 10
file content (46 lines) | stat: -rw-r--r-- 866 bytes parent folder | download | duplicates (2)
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
//#define XERR
#include "pgpsection.ih"

bool PGPSection::complete() //ostream &out)
{
    d_pgpMessage << g_beginPGP << '\n';

    d_firstLine = g_lineNr;

    next();                         // BEGIN PGP MESSAGE has already been read
    nextLine();

    if (
            empty()         
        and lines()  
        and lastLine() 
        and endMessage()
    )
    {
        if (d_pgpRanges)
        {
            ostringstream str;
            str << g_filename << ':' << d_firstLine << ':' << g_lineNr << 
                    ": PGP MESSAGE";
            starred(// out, 
                    str.str());
        }

        verbose("complete");
        return true;
    }

    if (d_offset != 0)
    {
        if (not d_in.seekg(d_offset))
            throw Exception{} << "repositioning failed";

        g_lineNr = d_nextNr;
    }

    return false;
}