inc-expand.cc
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // inc-expand: read/write specified text, replacing each #include
4 // directive with the corresponding file's contents
5 //
6 // ======================================================================
7 
9 #include "cetlib/includer.h"
10 #include "cetlib_except/exception.h"
11 #include <algorithm>
12 #include <iostream>
13 #include <iterator>
14 #include <string>
15 
17 
18 // ----------------------------------------------------------------------
19 
20 int
21 do_including(std::string const& from, std::ostream& to) try {
22  cet::includer inc(from, identity_filepath);
23 
26 
27  std::ostream_iterator<char> out(to);
28  std::copy(it, end, out);
29 
30  return 0;
31 }
32 catch (cet::exception const& e) {
33  return 1;
34 } // do_including()
35 
36 // ----------------------------------------------------------------------
37 
38 int
39 main(int argc, char* argv[])
40 {
41  int nfailures = 0;
42 
43  for (int k = 1; k != argc; ++k)
44  nfailures += do_including(argv[k], std::cout);
45 
46  return nfailures;
47 
48 } // main()
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
const_iterator end() const
Definition: includer.h:40
std::string string
Definition: nybbler.cc:12
const_iterator begin() const
Definition: includer.h:35
const double e
int main(int argc, char *argv[])
Definition: inc-expand.cc:39
cet::filepath_maker identity_filepath
Definition: inc-expand.cc:16
int do_including(std::string const &from, std::ostream &to)
Definition: inc-expand.cc:21
T copy(T const &v)
std::string::const_iterator const_iterator
Definition: includer.h:27
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33