Cppcheck
Static Public Member Functions | List of all members
FileLister Class Reference

Cross-platform FileLister. More...

#include <filelister.h>

Static Public Member Functions

static std::string recursiveAddFiles (std::list< FileWithDetails > &files, const std::string &path, const PathMatch &ignored)
 Recursively add source files to a map. More...
 
static std::string recursiveAddFiles (std::list< FileWithDetails > &files, const std::string &path, const std::set< std::string > &extra, const PathMatch &ignored)
 Recursively add source files to a map. More...
 
static std::string addFiles (std::list< FileWithDetails > &files, const std::string &path, const std::set< std::string > &extra, bool recursive, const PathMatch &ignored)
 (Recursively) add source files to a map. More...
 

Detailed Description

Cross-platform FileLister.

Definition at line 35 of file filelister.h.

Member Function Documentation

◆ addFiles()

std::string FileLister::addFiles ( std::list< FileWithDetails > &  files,
const std::string &  path,
const std::set< std::string > &  extra,
bool  recursive,
const PathMatch ignored 
)
static

(Recursively) add source files to a map.

Add source files from given directory and all subdirectries to the given map. Only files with accepted extensions (*.c;*.cpp;*.cxx;*.c++;*.cc;*.txx) are added.

Parameters
filesoutput list that associates the size of each file with its name
pathroot path
extraExtra file extensions
recursiveEnable recursion
ignoredignored paths
Returns
On success, an empty string is returned. On error, a error message is returned.

Definition at line 246 of file filelister.cpp.

References addFiles2(), endsWith(), and FileWithDetails::path().

Referenced by recursiveAddFiles().

◆ recursiveAddFiles() [1/2]

static std::string FileLister::recursiveAddFiles ( std::list< FileWithDetails > &  files,
const std::string &  path,
const PathMatch ignored 
)
inlinestatic

Recursively add source files to a map.

Add source files from given directory and all subdirectries to the given map. Only files with accepted extensions (*.c;*.cpp;*.cxx;*.c++;*.cc;*.txx) are added.

Parameters
filesoutput list that associates the size of each file with its name
pathroot path
ignoredignored paths
Returns
On success, an empty string is returned. On error, a error message is returned.

Definition at line 47 of file filelister.h.

Referenced by CmdLineParser::fillSettingsFromArgs().

◆ recursiveAddFiles() [2/2]

std::string FileLister::recursiveAddFiles ( std::list< FileWithDetails > &  files,
const std::string &  path,
const std::set< std::string > &  extra,
const PathMatch ignored 
)
static

Recursively add source files to a map.

Add source files from given directory and all subdirectries to the given map. Only files with accepted extensions (*.c;*.cpp;*.cxx;*.c++;*.cc;*.txx) are added.

Parameters
filesoutput list that associates the size of each file with its name
pathroot path
extraExtra file extensions
ignoredignored paths
Returns
On success, an empty string is returned. On error, a error message is returned.

Definition at line 270 of file filelister.cpp.

References addFiles().


The documentation for this class was generated from the following files: