summaryrefslogtreecommitdiff
path: root/support/lintex/cxx/ltx.hh
blob: ce41519d571c80fca3d2ce75255385bbce3cef5d (plain)
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
//     Author: Maurizio Loreti, aka MLO or (HAM) I3NOO
//     Work:   University of Padova - Department of Physics
//             Via F. Marzolo, 8 - 35131 PADOVA - Italy
//     Phone:  +39 (049) 827-7216   FAX: +39 (049) 827-7102
//     EMail:  loreti@pd.infn.it
//     WWW:    http://www.pd.infn.it/~loreti/mlo.html
//
// -------------------------------------------------------------------
//
//     $Id: ltx.hh,v 1.2 2002/09/12 10:15:44 loreti Exp $
//
// -------------------------------------------------------------------

#include <functional>
#include <iostream>
#include <string>

// Auxiliary function object used to print (on an output stream) a
// leading text followed by the argument string and an end-of-line.

class printBefore : public std::unary_function< std::string, void > {
private:
  const std::string  & _leader;
        std::ostream & _os;

public:
  printBefore(const std::string & b = "", std::ostream & o = std::cout)
    : _leader(b), _os(o) {}
  ~printBefore() {}
  void operator() (const std::string & s) { _os << _leader << s << std::endl; }
};

// Global variables (declaration)

namespace ltx {
  extern std::string            progname;
  extern std::string            trailEd;
  extern std::string::size_type lTrailEd;
  extern bool                   confirm;
  extern bool                   recurse;
}