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
|