ProSHADE
0.6.5 (NOV 2018)
Protein Shape Descriptors and Symmetry Detection
|
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... | |
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.
Definition in file ProSHADE_files.h.
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.
[in] | saveFiles | This is a pointer to the vector of strings to which all found file paths are to be saved. |
[in] | path | This is the path which should be searched (including all sub-directories). |
[in] | ext | This is the extension which the files are required to have. Leave "" for any extension. |
[out] | X | Bool value indicating whether the function have failed or suceeded. |
Definition at line 42 of file ProSHADE_files.cpp.