ProSHADE  0.6.5 (NOV 2018)
Protein Shape Descriptors and Symmetry Detection
ProSHADE_files.h File Reference

This header file contains function and globals required for platform-independent file detection. More...

#include <iostream>
#include <cstring>
#include <dirent.h>
#include <vector>

Go to the source code of this file.

Namespaces

 ProSHADE_files
 This namespace contains a single function to find files in file tree.
 

Functions

bool ProSHADE_internal_files::findFiles (std::vector< std::string > *saveFiles, const char *path, const char *ext)
 Function to recursively search for files with given extension in the file path supplied. More...
 

Detailed Description

The following code is a simple header for function to locate all files within a given path and with given extension. To use the function, simply supply the address of vector of strings to which the paths to all recovered files are to be saved, the path to start searching and the extension required. For no extension, use "". Also, note that the function is recursive by default and minor changes to the code would be required to remove this behaviour.

This file is part of the ProSHADE library for calculating shape descriptors and symmetry operators of protein structures. This is a prototype code, which is by no means complete or fully tested. Its use is at your own risk only. There is no quarantee that the results are correct.

Author
Michal Tykac
Garib N. Murshudov
Version
0.6.5
Date
NOV 2018

Definition in file ProSHADE_files.h.

Function Documentation

§ findFiles()

bool ProSHADE_internal_files::findFiles ( std::vector< std::string > *  saveFiles,
const char *  path,
const char *  ext 
)

This function searches a given folder and all subfolders (recursively) for any and all files with the extension given. It will return all files if no extension is given (i.e. the extension parameter is ""). Upon completing the search, the funciton will save the full paths to all found files in a vector and returns it.

Parameters
[in]saveFilesThis is a pointer to the vector of strings to which all found file paths are to be saved.
[in]pathThis is the path which should be searched (including all sub-directories).
[in]extThis is the extension which the files are required to have. Leave "" for any extension.
[out]XBool value indicating whether the function have failed or suceeded.
Warning
The function is recursive by default.
The function was never tested on windows.
There is no guarantee that the function return order will not change between runs with the same parameters.
This is an internal function which should not be used by the user.

Definition at line 42 of file ProSHADE_files.cpp.