PathFinder Class Reference

Performs a case-insensitive (OS independent) file searches. More...

#include <pathfinder.h>

Public Member Functions

 PathFinder ()
 Constructs PathFinder where paths are read from program configuration. More...
 
 PathFinder (const QStringList &paths)
 Constructs PathFinder with custom paths. More...
 
void addPrioritySearchDir (const QString &dir)
 
QString findFile (const QString &fileName) const
 Performs a search for a single file. More...
 
PathFinderResult findFiles (const QStringList &files) const
 Performs a search for multiple files, marking them as found or missing. More...
 

Detailed Description

Performs a case-insensitive (OS independent) file searches.

This object is copyable.

On case-insensitive file systems (like NTFS) the search is simple and doesn't differ from what one would expect of the system tools to do.

On case-sensitive file systems (Linux FS-es) the search goes against the principles of the OS and treats files with alternating letter case the same. So, on Linux doom2.wad, DOOM2.WAD and doom2.WAD are all treated as equal. If more than one file is present in a searched directory, only one path is returned and it's undefined which one will it be.

Search is performed in a set of paths retrieved from configuration or specified manually through constructor and addPrioritySearchDir().

Definition at line 81 of file pathfinder.h.

Constructor & Destructor Documentation

PathFinder::PathFinder ( )

Constructs PathFinder where paths are read from program configuration.

PathFinder::PathFinder ( const QStringList &  paths)

Constructs PathFinder with custom paths.

Program configuration is skipped here.

Definition at line 92 of file pathfinder.cpp.

Member Function Documentation

void PathFinder::addPrioritySearchDir ( const QString &  dir)

Provides a directory where we should search first before going to user specified locations. This function can take either a directory or a file as its input. If a file is given the directory part will be extracted.

Definition at line 104 of file pathfinder.cpp.

QString PathFinder::findFile ( const QString &  fileName) const

Performs a search for a single file.

Definition at line 122 of file pathfinder.cpp.

PathFinderResult PathFinder::findFiles ( const QStringList &  files) const

Performs a search for multiple files, marking them as found or missing.

Definition at line 140 of file pathfinder.cpp.


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