Cppcheck
Static Public Member Functions
FileLister Class Reference

Cross-platform FileLister. More...

#include <filelister.h>

List of all members.

Static Public Member Functions

static void recursiveAddFiles (std::map< std::string, std::size_t > &files, const std::string &path)
 Recursively add source files to a map.
static bool isDirectory (const std::string &path)
 Is given path a directory?
static bool fileExists (const std::string &path)
 Check if the given path is a file and if it exists?
static std::string getAbsolutePath (const std::string &path)
static void recursiveAddFiles2 (std::set< std::string > &seen_paths, std::map< std::string, std::size_t > &files, const std::string &path)

Detailed Description

Cross-platform FileLister.

Definition at line 30 of file filelister.h.


Member Function Documentation

bool FileLister::fileExists ( const std::string &  path) [static]

Check if the given path is a file and if it exists?

Returns:
true if path points to file and the file exists.

Definition at line 260 of file filelister.cpp.

std::string FileLister::getAbsolutePath ( const std::string &  path) [static]

Definition at line 169 of file filelister.cpp.

Referenced by recursiveAddFiles2().

bool FileLister::isDirectory ( const std::string &  path) [static]

Is given path a directory?

Returns:
returns true if the path is a directory

Definition at line 243 of file filelister.cpp.

Referenced by CmdLineParser::ParseFromArgs(), and CppCheckExecutor::parseFromArgs().

void FileLister::recursiveAddFiles ( std::map< std::string, std::size_t > &  files,
const std::string &  path 
) [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 map that associates the size of each file with its name
pathroot path

Definition at line 237 of file filelister.cpp.

References recursiveAddFiles2().

Referenced by CppCheckExecutor::parseFromArgs().

void FileLister::recursiveAddFiles2 ( std::set< std::string > &  seen_paths,
std::map< std::string, std::size_t > &  files,
const std::string &  path 
) [static]

Definition at line 188 of file filelister.cpp.

References Path::acceptFile(), getAbsolutePath(), and Path::sameFileName().

Referenced by recursiveAddFiles().


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