File: printers.hpp

package info (click to toggle)
dtl 1.19-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 424 kB
  • sloc: cpp: 2,214; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 769 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
#ifndef DTL_PRINTERS
#define DTL_PRINTERS

template <typename sesElem, typename stream = ostream >
class customChangePrinter : public Printer < sesElem, stream >
{
public :
    customChangePrinter () : Printer < sesElem, stream > () {}
    customChangePrinter (stream& out) : Printer < sesElem, stream > (out) {}
    ~customChangePrinter () {}
    void operator() (const sesElem& se) const {
        switch (se.second.type) {
        case SES_ADD:
            this->out_ << "Add: " << se.first << endl;
            break;
        case SES_DELETE:
            this->out_ << "Delete: " << se.first << endl;
            break;
        case SES_COMMON:
            this->out_ << "Common: " << se.first << endl;
            break;
        }
    }
};

#endif // DTL_PRINTERS