// file : tests/compiler/sloc-counter/driver.cxx // copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #include #include #include #include using namespace std; using namespace cutl::compiler; int main (int argc, char* argv[]) { if (argc != 2) { cerr << "usage: " << argv[0] << " " << endl; return 1; } ostream_filter filt (cout); ifstream ifs(argv[1]); for (istream::int_type c (ifs.get ()); c != istream::traits_type::eof (); c = ifs.get ()) { cout.put (istream::traits_type::to_char_type (c)); } cout << endl << filt.stream ().count () << endl; }