1#ifndef INCLUDE_LIB_FSI_INDEXER_HPP_
2#define INCLUDE_LIB_FSI_INDEXER_HPP_
10#define __FSI_SUCCESS 0
11#define __FSI_INDEXERERR_CHECK(e) \
12 (e.raise || e.fatal) && e.code != __FSI_SUCCESS
86 virtual std::vector<std::string>
__iteratePath(
const std::string &path);
124 static std::vector<std::vector<std::string>>
__splitPathByCores(
const std::vector<std::string> &paths)
126 const unsigned int threads = std::max(1u, std::thread::hardware_concurrency());
128 std::vector<std::vector<std::string>> chunks(threads);
130 for (
size_t i = 0; i < paths.size(); ++i)
131 chunks[i % threads].push_back(paths[i]);
207 std::string
getID()
const;
virtual std::vector< std::string > __searchMatchingStandard(const std::string &find)
Search all matching path or ID that contains path.
virtual IndexerPathType __getPathType(const std::string &path) const
Get if path from function param is a:
IndexerInfo findIndex(const std::string &toFind)
Find the index from the vector database from the indexer.
std::vector< IndexerInfo > indexerInfo
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.
IndexerError addInfo(const IndexerInfo &info)
Add the exact path to have the info from.
IndexerError removeInfo(const std::string &searcher)
Remove information from its ID or full path.
utils::TimeUtils_DateTime getFileDTInfo(const std::string &path)
Get when the file, dir or symlink was last modified.
std::vector< std::string > searchMatching(const std::string &path)
Either use threaded or unthreaded search matching.
Indexer(const std::string &id, const bool threadsImpl=false)
std::vector< std::string > getIndexPaths() const
Get all the indexed paths from the vector indexes.
std::string searchExactMatching(const std::string &find)
Search for an exact matching path or ID;.
virtual IndexerError __addExtendedInfoThreaded(const IndexerInfo &info)
Threaded extended information.
std::string getID() const
Get this object's ID.
IndexerError addExtendedInfo(const IndexerInfo &info)
Add the exact path and the sub-paths to have the info from;.
std::vector< IndexerInfo > getIndexerInfo() const
Return indexer information from this object.
virtual std::vector< std::string > __iteratePath(const std::string &path)
Iterate all the files and directories (symlinks too) from path.
virtual IndexerError __addExtendedInfoStandard(const IndexerInfo &info)
Standard non-threaded extended information.
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.
constexpr int ERROR_ADDITION_FAIL
constexpr int ERROR_INVALID_PATH
constexpr int ERROR_ERASE_FAIL
constexpr int ERROR_EMPTY_VALUE
struct fsi::IndexerFoundInfo IndexerFoundInfo
struct fsi::IndexerInfo IndexerInfo
struct fsi::IndexerError IndexerError
utils::TimeUtils_DateTime lastModDT