My Project
|
it represents the search result. More...
#include <FileSearchResult.h>
Public Member Functions | |
PE_CORE_DECL void | Release () |
release results. More... | |
PE_CORE_DECL const std::string & | GetRootPath () |
get the root path | |
PE_CORE_DECL int | GetNumOfResult () |
get the total number of result found | |
PE_CORE_DECL bool | AddResult (const CFileFindData &item) |
add a new item. More... | |
PE_CORE_DECL bool | AddResult (const std::string &sItem, DWORD dwFileSize=0, DWORD dwFileAttributes=0, const FILETIME *ftLastWriteTime=0, const FILETIME *ftCreationTime=0, const FILETIME *ftLastAccessTime=0) |
add a new item. More... | |
PE_CORE_DECL const CFileFindData * | GetItemData (int nIndex) |
get the item at the specified index. More... | |
PE_CORE_DECL const std::string & | GetItem (int nIndex) |
get the item at the specified index. More... | |
void | InitSearch (const std::string &sRootPath, int nSubLevel=0, int nMaxFilesNum=50, int nFrom=0) |
clear previous search result and begin a new search More... | |
void | SetRootPath (const std::string &sRoot) |
Protected Attributes | |
std::string | m_rootPath |
std::vector< CFileFindData > | m_results |
std::set< std::string > | m_filenames |
int | m_nSubLevel |
how many sub folders of sRootPath to look into. default value is 0, which only searches the sRootPath folder. | |
int | m_nMaxFilesNum |
one can limit the total number of files in the search result. Default value is 50. the search will stop at this value even there are more matching files. | |
int | m_nFrom |
only contains results from nFrom to (nFrom+nMaxFilesNum) | |
int | m_nFileNumber |
it represents the search result.
bool CSearchResult::AddResult | ( | const CFileFindData & | item | ) |
add a new item.
return false if the search is completed.
PE_CORE_DECL bool ParaEngine::CSearchResult::AddResult | ( | const std::string & | sItem, |
DWORD | dwFileSize = 0 , |
||
DWORD | dwFileAttributes = 0 , |
||
const FILETIME * | ftLastWriteTime = 0 , |
||
const FILETIME * | ftCreationTime = 0 , |
||
const FILETIME * | ftLastAccessTime = 0 |
||
) |
add a new item.
return false if the search is completed.
const string & CSearchResult::GetItem | ( | int | nIndex | ) |
get the item at the specified index.
return "" if nIndex is out of range.
const CFileFindData * CSearchResult::GetItemData | ( | int | nIndex | ) |
get the item at the specified index.
return NULL if nIndex is out of range.
void CSearchResult::InitSearch | ( | const std::string & | sRootPath, |
int | nSubLevel = 0 , |
||
int | nMaxFilesNum = 50 , |
||
int | nFrom = 0 |
||
) |
clear previous search result and begin a new search
sRootPath | the root path. for example: "", "xmodel/","xmodel/models/". Other format is not acceptable |
nSubLevel | how many sub folders of sRootPath to look into. default value is 0, which only searches the sRootPath folder. |
nMaxFilesNum | one can limit the total number of files in the search result. Default value is 50. the search will stop at this value even there are more matching files. |
nFrom | only contains results from nFrom to (nFrom+nMaxFilesNum) |
void CSearchResult::Release | ( | ) |
release results.