File: process.h

package info (click to toggle)
yodl 4.04.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 4,720 kB
  • sloc: ansic: 7,803; perl: 683; cpp: 570; sh: 411; xml: 190; makefile: 164
file content (69 lines) | stat: -rw-r--r-- 1,540 bytes parent folder | download | duplicates (4)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef INCLUDED_PROCESS_
#define INCLUDED_PROCESS_

#include <string>

#include "../linetype/linetype.h"
#include "../out/out.h"

class Line;

class Process: private LineType
{
    Line &d_line;
    Out d_out;

    void (Process::*d_run)() = 0;

    public:
        Process(Line &line);

                                            // configure Process:
        void all();                         //  -A
        void indent(size_t count, int ch);  // line indentation
        void noVerb();                      // do not use verb(...)
        void noVerbEndl();                  // no \n after verb
        void numberLines();                 // lines are numbered
        void setTarget(char const *target); // specify the target marker
        void vindent(size_t count, int ch); // verb-indentation
        
        void run();                         // process the input file

    private:
        void processAll();                  // either process all lines
        void processTarget();               // or process lines in target
                                            // sections 
};

        
inline void Process::all()
{
    d_run = &Process::processAll;
}

inline void Process::noVerb()
{
    d_out.noVerb();
}

inline void Process::noVerbEndl()
{
    d_out.noVerbEndl();
}

inline void Process::indent(size_t count, int ch)
{
    d_out.indent(count, ch);
}

inline void Process::vindent(size_t count, int ch)
{
    d_out.vindent(count, ch);
}

inline void Process::numberLines()
{
    d_out.numberLines();
}

#endif