File: printers.hpp

package info (click to toggle)
dtl 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: cpp: 2,285; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 838 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
#ifndef DTL_PRINTERS
#define DTL_PRINTERS

#include <dtl/dtl.hpp>

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

#endif // DTL_PRINTERS