|
FileSystemIndexer v0.1.2-beta
File System Indexer - An API to index files from your system
|
#include <FSI_Indexer.hpp>

Public Member Functions | |
| Indexer (const std::string &id, const bool threadsImpl=false) | |
| ~Indexer () | |
| IndexerError | addExtendedInfo (const IndexerInfo &info) |
| Add the exact path and the sub-paths to have the info from;. | |
| IndexerError | addInfo (const IndexerInfo &info) |
| Add the exact path to have the info from. | |
| IndexerInfo | findIndex (const std::string &toFind) |
| Find the index from the vector database from the indexer. | |
| utils::TimeUtils_DateTime | getFileDTInfo (const std::string &path) |
| Get when the file, dir or symlink was last modified. | |
| std::string | getID () const |
| Get this object's ID. | |
| std::vector< IndexerInfo > | getIndexerInfo () const |
| Return indexer information from this object. | |
| std::vector< std::string > | getIndexPaths () const |
| Get all the indexed paths from the vector indexes. | |
| IndexerError | removeInfo (const std::string &searcher) |
| Remove information from its ID or full path. | |
| std::string | searchExactMatching (const std::string &find) |
| Search for an exact matching path or ID;. | |
| std::vector< std::string > | searchMatching (const std::string &path) |
| Either use threaded or unthreaded search matching. | |
Protected Member Functions | |
| virtual IndexerError | __addExtendedInfoStandard (const IndexerInfo &info) |
| Standard non-threaded extended information. | |
| virtual IndexerError | __addExtendedInfoThreaded (const IndexerInfo &info) |
| Threaded extended information. | |
| virtual IndexerPathType | __getPathType (const std::string &path) const |
| Get if path from function param is a: | |
| virtual std::vector< std::string > | __iteratePath (const std::string &path) |
| Iterate all the files and directories (symlinks too) from path. | |
| virtual std::vector< std::string > | __searchMatchingStandard (const std::string &find) |
| Search all matching path or ID that contains path. | |
| virtual std::vector< std::string > | __searchMatchingThreaded (const std::string &find) |
| Search all matching path or ID that contains path using parallelization with multiple CPU threads. | |
Static Protected Member Functions | |
| static std::vector< std::vector< std::string > > | __splitPathByCores (const std::vector< std::string > &paths) |
| Split the paths found to be used in the future in different CPU cores. | |
Private Attributes | |
| std::string | id |
| std::vector< IndexerInfo > | indexerInfo |
| bool | threadsImpl |
Definition at line 60 of file FSI_Indexer.hpp.
| fsi::Indexer::Indexer | ( | const std::string & | id, |
| const bool | threadsImpl = false ) |
Definition at line 167 of file FSI_Indexer.cpp.
References Indexer(), id, and threadsImpl.
Referenced by Indexer().


| fsi::Indexer::~Indexer | ( | ) |
Definition at line 172 of file FSI_Indexer.cpp.
|
protectedvirtual |
Standard non-threaded extended information.
| info | Get the information from the exact path and deeper |
Definition at line 69 of file FSI_Indexer.cpp.
References __addExtendedInfoStandard(), __FSI_INDEXERERR_CHECK, __getPathType(), __iteratePath(), addInfo(), indexerInfo, fsi::IndexerInfo::path, and fsi::IndexerInfo::pathType.
Referenced by __addExtendedInfoStandard(), and addExtendedInfo().


|
protectedvirtual |
Threaded extended information.
| info | Get the information from the exact path and deeper |
Definition at line 90 of file FSI_Indexer.cpp.
References __addExtendedInfoThreaded(), __FSI_INDEXERERR_CHECK, __getPathType(), __iteratePath(), __splitPathByCores(), addInfo(), indexerInfo, fsi::IndexerInfo::path, and fsi::IndexerInfo::pathType.
Referenced by __addExtendedInfoThreaded(), and addExtendedInfo().


|
protectedvirtual |
Get if path from function param is a:
| path | Path to get the type from |
Definition at line 20 of file FSI_Indexer.cpp.
References fsi::Directory, fsi::File, and fsi::SymLink.
Referenced by __addExtendedInfoStandard(), __addExtendedInfoThreaded(), and addInfo().

|
protectedvirtual |
Iterate all the files and directories (symlinks too) from path.
| path | Path to iterate |
Definition at line 140 of file FSI_Indexer.cpp.
References __iteratePath(), FSI_FREE, and fsi_walk().
Referenced by __addExtendedInfoStandard(), __addExtendedInfoThreaded(), and __iteratePath().


|
protectedvirtual |
Search all matching path or ID that contains path.
| path | Path or ID to search |
Definition at line 28 of file FSI_Indexer.cpp.
References indexerInfo.
Referenced by searchMatching().

|
protectedvirtual |
Search all matching path or ID that contains path using parallelization with multiple CPU threads.
| path | Path or ID to search |
Definition at line 44 of file FSI_Indexer.cpp.
References indexerInfo.
Referenced by searchMatching().

|
inlinestaticprotected |
Split the paths found to be used in the future in different CPU cores.
| paths | The paths to split according to CPU cores |
Definition at line 124 of file FSI_Indexer.hpp.
Referenced by __addExtendedInfoThreaded().

| IndexerError fsi::Indexer::addExtendedInfo | ( | const IndexerInfo & | info | ) |
Add the exact path and the sub-paths to have the info from;.
| info | Get the information from the exact path and deeper |
Definition at line 175 of file FSI_Indexer.cpp.
References __addExtendedInfoStandard(), __addExtendedInfoThreaded(), and threadsImpl.
Referenced by main().


| IndexerError fsi::Indexer::addInfo | ( | const IndexerInfo & | info | ) |
Add the exact path to have the info from.
| info | Get the information from the exact path |
Definition at line 198 of file FSI_Indexer.cpp.
References __getPathType(), fsi::IndexerError::code, fsi::codes::ERROR_ADDITION_FAIL, fsi::codes::ERROR_INVALID_PATH, fsi::IndexerError::fatal, indexerInfo, fsi::IndexerError::message, fsi::IndexerInfo::path, fsi::IndexerInfo::pathType, and fsi::IndexerError::raise.
Referenced by __addExtendedInfoStandard(), and __addExtendedInfoThreaded().


| IndexerInfo fsi::Indexer::findIndex | ( | const std::string & | toFind | ) |
Find the index from the vector database from the indexer.
| toFind | Search for the path or ID and remove them from the indexer |
Definition at line 234 of file FSI_Indexer.cpp.
References indexerInfo.
Referenced by main(), and searchExactMatching().

| utils::TimeUtils_DateTime fsi::Indexer::getFileDTInfo | ( | const std::string & | path | ) |
Get when the file, dir or symlink was last modified.
| path | Path to get date time information |
Definition at line 275 of file FSI_Indexer.cpp.
References fsi::utils::fsClockDataToDT().
Referenced by main().


| std::string fsi::Indexer::getID | ( | ) | const |
Get this object's ID.
Definition at line 295 of file FSI_Indexer.cpp.
References id.
| std::vector< IndexerInfo > fsi::Indexer::getIndexerInfo | ( | ) | const |
Return indexer information from this object.
Definition at line 282 of file FSI_Indexer.cpp.
References indexerInfo.
| std::vector< std::string > fsi::Indexer::getIndexPaths | ( | ) | const |
Get all the indexed paths from the vector indexes.
Definition at line 285 of file FSI_Indexer.cpp.
References indexerInfo.
| IndexerError fsi::Indexer::removeInfo | ( | const std::string & | searcher | ) |
Remove information from its ID or full path.
| searcher | Search for the path or ID and remove them from the indexer |
Definition at line 245 of file FSI_Indexer.cpp.
References fsi::IndexerError::code, fsi::codes::ERROR_EMPTY_VALUE, fsi::IndexerError::fatal, indexerInfo, fsi::IndexerError::message, and fsi::IndexerError::raise.
| std::string fsi::Indexer::searchExactMatching | ( | const std::string & | find | ) |
Search for an exact matching path or ID;.
| find | Get the ID or path to find |
Definition at line 183 of file FSI_Indexer.cpp.
References findIndex(), and fsi::IndexerInfo::path.

| std::vector< std::string > fsi::Indexer::searchMatching | ( | const std::string & | path | ) |
Either use threaded or unthreaded search matching.
| path | Path to read the data to search |
Definition at line 191 of file FSI_Indexer.cpp.
References __searchMatchingStandard(), __searchMatchingThreaded(), and threadsImpl.
Referenced by main().


|
private |
Definition at line 63 of file FSI_Indexer.hpp.
|
private |
Definition at line 65 of file FSI_Indexer.hpp.
Referenced by __addExtendedInfoStandard(), __addExtendedInfoThreaded(), __searchMatchingStandard(), __searchMatchingThreaded(), addInfo(), findIndex(), getIndexerInfo(), getIndexPaths(), and removeInfo().
|
private |
Definition at line 67 of file FSI_Indexer.hpp.
Referenced by Indexer(), addExtendedInfo(), and searchMatching().