flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
flexiblesusy::depgen Namespace Reference

Classes

struct  Config
 
struct  Is_not_duplicate
 
struct  Is_not_duplicate_ignore_path
 

Functions

std::vector< std::string > complement (const std::vector< std::string > &v1, const std::vector< std::string > &v2)
 returns all elements of ‘v1’, which are not ‘v2’ More...
 
template<typename T >
std::string concat (const std::vector< std::string > &strings, const T &separator)
 concatenate strings with separator More...
 
template<typename Predicate = decltype(Is_not_duplicate())>
std::vector< std::string > delete_duplicates (const std::vector< std::string > &vec, Predicate pred=Is_not_duplicate())
 deletes duplicate elements from a vector (preseves order) More...
 
std::string directory (const std::string &file_name)
 returns directory from file name More...
 
bool file_exists (const std::string &name)
 checks if given file exists More...
 
std::string filename (const std::string &file_name)
 returns file name w/o directory More...
 
std::vector< std::string > filenames (const std::vector< std::string > &file_names)
 returns file names w/o directory More...
 
template<class Predicate >
std::vector< std::string > filter (const std::vector< std::string > &vec, const Predicate &pred)
 returns elements of ‘vec’ for which pred(f) == true More...
 
template<class Predicate >
std::vector< std::string > filter_files (const std::string &dir, const std::vector< std::string > &files, const Predicate &pred)
 returns files in directory ‘dir’ for which pred(f) == true More...
 
template<class OutputIterator >
void get_filename_from_include (const char *s, OutputIterator it)
 extracts file name from include "..." statement More...
 
std::vector< std::string > get_included_files (const std::string &file_name)
 extract include statements from file (ignoring system headers) More...
 
std::vector< std::string > insert_at_front (const std::vector< std::string > &strings, const std::string &str)
 insert ‘str’ at the beginning of vector More...
 
std::vector< std::string > prepend (const std::string &str, const std::vector< std::string > &strings)
 prepend ‘str’ to all strings More...
 
void print_dependencies (std::ostream &ostr, const std::string &target_name, const std::vector< std::string > &dependencies)
 print dependency list More...
 
void print_empty_phony_targets (std::ostream &ostr, const std::vector< std::string > &dependencies)
 print empty phony targets for each dependency More...
 
void print_usage (const std::string &program_name)
 print usage message More...
 
std::string replace_extension (const std::string &str, const std::string &ext)
 replace file name extension by ‘ext’ More...
 
std::vector< std::string > search_includes (const Config &config, int max_depth=100)
 
void search_includes (const Config &config, std::vector< std::string > &result, int max_depth)
 
bool starts_with (const std::string &str, const std::string &prefix)
 tests whether ‘str’ starts with ‘prefix’ More...
 

Function Documentation

◆ complement()

std::vector< std::string > flexiblesusy::depgen::complement ( const std::vector< std::string > &  v1,
const std::vector< std::string > &  v2 
)

returns all elements of ‘v1’, which are not ‘v2’

Definition at line 273 of file depgen.cpp.

References flexiblesusy::amm_loop_functions::two_loop::anonymous_namespace{amm_loop_functions.cpp}::sort().

Referenced by search_includes().

◆ concat()

template<typename T >
std::string flexiblesusy::depgen::concat ( const std::vector< std::string > &  strings,
const T &  separator 
)

concatenate strings with separator

Definition at line 294 of file depgen.cpp.

Referenced by search_includes().

◆ delete_duplicates()

template<typename Predicate = decltype(Is_not_duplicate())>
std::vector< std::string > flexiblesusy::depgen::delete_duplicates ( const std::vector< std::string > &  vec,
Predicate  pred = Is_not_duplicate() 
)

deletes duplicate elements from a vector (preseves order)

Definition at line 98 of file depgen.cpp.

References flexiblesusy::f().

Referenced by main().

◆ directory()

std::string flexiblesusy::depgen::directory ( const std::string &  file_name)

returns directory from file name

Definition at line 47 of file depgen.cpp.

Referenced by main().

◆ file_exists()

bool flexiblesusy::depgen::file_exists ( const std::string &  name)

checks if given file exists

Definition at line 71 of file depgen.cpp.

Referenced by main(), and search_includes().

◆ filename()

std::string flexiblesusy::depgen::filename ( const std::string &  file_name)

returns file name w/o directory

Definition at line 56 of file depgen.cpp.

Referenced by filenames(), main(), flexiblesusy::depgen::Is_not_duplicate_ignore_path::operator()(), and flexiblesusy::print_fatal().

◆ filenames()

std::vector< std::string > flexiblesusy::depgen::filenames ( const std::vector< std::string > &  file_names)

returns file names w/o directory

Definition at line 63 of file depgen.cpp.

References filename().

Referenced by search_includes().

◆ filter()

template<class Predicate >
std::vector< std::string > flexiblesusy::depgen::filter ( const std::vector< std::string > &  vec,
const Predicate &  pred 
)

returns elements of ‘vec’ for which pred(f) == true

Definition at line 247 of file depgen.cpp.

Referenced by filter_files().

◆ filter_files()

template<class Predicate >
std::vector< std::string > flexiblesusy::depgen::filter_files ( const std::string &  dir,
const std::vector< std::string > &  files,
const Predicate &  pred 
)

returns files in directory ‘dir’ for which pred(f) == true

Definition at line 261 of file depgen.cpp.

References filter(), and prepend().

Referenced by search_includes().

◆ get_filename_from_include()

template<class OutputIterator >
void flexiblesusy::depgen::get_filename_from_include ( const char *  s,
OutputIterator  it 
)

extracts file name from include "..." statement

Definition at line 168 of file depgen.cpp.

Referenced by get_included_files().

◆ get_included_files()

std::vector< std::string > flexiblesusy::depgen::get_included_files ( const std::string &  file_name)

extract include statements from file (ignoring system headers)

Definition at line 207 of file depgen.cpp.

References get_filename_from_include().

Referenced by search_includes().

◆ insert_at_front()

std::vector< std::string > flexiblesusy::depgen::insert_at_front ( const std::vector< std::string > &  strings,
const std::string &  str 
)

insert ‘str’ at the beginning of vector

Definition at line 235 of file depgen.cpp.

Referenced by main().

◆ prepend()

std::vector< std::string > flexiblesusy::depgen::prepend ( const std::string &  str,
const std::vector< std::string > &  strings 
)

prepend ‘str’ to all strings

Definition at line 221 of file depgen.cpp.

Referenced by filter_files().

◆ print_dependencies()

void flexiblesusy::depgen::print_dependencies ( std::ostream &  ostr,
const std::string &  target_name,
const std::vector< std::string > &  dependencies 
)

print dependency list

Definition at line 147 of file depgen.cpp.

Referenced by main().

◆ print_empty_phony_targets()

void flexiblesusy::depgen::print_empty_phony_targets ( std::ostream &  ostr,
const std::vector< std::string > &  dependencies 
)

print empty phony targets for each dependency

Definition at line 160 of file depgen.cpp.

Referenced by main().

◆ print_usage()

void flexiblesusy::depgen::print_usage ( const std::string &  program_name)

print usage message

Definition at line 124 of file depgen.cpp.

Referenced by main().

◆ replace_extension()

std::string flexiblesusy::depgen::replace_extension ( const std::string &  str,
const std::string &  ext 
)

replace file name extension by ‘ext’

Definition at line 111 of file depgen.cpp.

Referenced by main().

◆ search_includes() [1/2]

std::vector< std::string > flexiblesusy::depgen::search_includes ( const Config config,
int  max_depth = 100 
)

search recursively for include statments in ‘file_name’ taking into account only directories given in ‘paths’

Definition at line 353 of file depgen.cpp.

References search_includes().

Referenced by main().

◆ search_includes() [2/2]

void flexiblesusy::depgen::search_includes ( const Config config,
std::vector< std::string > &  result,
int  max_depth 
)

◆ starts_with()

bool flexiblesusy::depgen::starts_with ( const std::string &  str,
const std::string &  prefix 
)

tests whether ‘str’ starts with ‘prefix’

Definition at line 118 of file depgen.cpp.

Referenced by main().