Typedefs | Functions
search_path_test_2.cc File Reference
#include "cetlib/search_path.h"
#include <algorithm>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>

Go to the source code of this file.

Typedefs

typedef std::vector< std::stringstrings_t
 

Functions

int main (int argc, char *argv[])
 

Typedef Documentation

Definition at line 17 of file search_path_test_2.cc.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 28 of file search_path_test_2.cc.

29 {
30  if (argc < 3) {
31  std::cerr << "usage: " << argv[0] << " regex_pattern directory_name\n";
32  return -1;
33  }
34 
35  strings_t results;
36  std::size_t count =
37  search_path(argv[2]).find_files(argv[1], std::back_inserter(results));
38 
39  std::copy(results.begin(),
40  results.end(),
41  std::ostream_iterator<std::string>(std::cout, "\n"));
42 
43  return count;
44 }
std::vector< std::string > strings_t
std::size_t find_files(std::string const &filename_pattern, std::vector< std::string > &result) const
Definition: search_path.cc:126
T copy(T const &v)