File: open.cc

package info (click to toggle)
natlog 3.01.00-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,912 kB
  • sloc: cpp: 3,691; fortran: 201; sh: 133; ansic: 123; makefile: 110
file content (18 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "rotatingstreambuf.ih"

                                            // receives --log (or --log-data)
void RotatingStreambuf::open(string const &name, bool stdLog)
{
    d_name = name;
    d_overflow = &RotatingStreambuf::unlockedOverflow;

    Exception::open(d_out, name, ios::in | ios::ate, ios::out);

    if (d_header and file_size(name) == 0)  // the std. log files don't have
        (*d_header)(d_out);                 // header lines

    if (stdLog)
        s_stdRotate.rotationStreambuf = this;
    else                   
        s_dataRotate.rotationStreambuf = this;
}