本文整理汇总了C++中CDirectory::fileExists方法的典型用法代码示例。如果您正苦于以下问题:C++ CDirectory::fileExists方法的具体用法?C++ CDirectory::fileExists怎么用?C++ CDirectory::fileExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDirectory
的用法示例。
在下文中一共展示了CDirectory::fileExists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
void CSingleIndexBarrelReader::open(const tchar* name)
{
m_name = name;
CDirectory* pDirectory = m_pIndex->getDirectory();
tstring s = m_name + _T(".fdi");
CIndexInput* pIndexInput = pDirectory->openInput(s.c_str());
m_pFieldsInfo->read(pIndexInput);
pIndexInput->close();
delete pIndexInput;
m_pStoredFieldsReader->open(pDirectory,name,m_pFieldsInfo);
m_pNormsReader->open(name,m_pFieldsInfo);
if(pDirectory->fileExists(m_name + _T(".del")))
{
CIndexInput* pDelInput = pDirectory->openInput(m_name + _T(".del"));
m_pDeletedDocs = new CBitVector(pDelInput);
delete pDelInput;
}
else m_pDeletedDocs = new CBitVector();
if(m_pTermReader)
{
delete m_pTermReader;
m_pTermReader = NULL;
}
if(m_pFieldsInfo->numIndexFields() > 1)
{
m_pTermReader = new CMultiFieldTermReader(pDirectory,name,m_pFieldsInfo,m_pDeletedDocs,getFactoryFinder());
m_pTermReader->setFilter(m_pDeletedDocs);
}
else if(m_pFieldsInfo->numIndexFields() == 1)
{
m_pFieldsInfo->startIterator();
CFieldInfo* pFieldInfo;
while (m_pFieldsInfo->hasNext())
{
pFieldInfo = m_pFieldsInfo->next();
if(pFieldInfo->isIndexed())
{
m_pTermReader = getFactoryFinder()->getFactory(pFieldInfo->getID())->createTermReader();
m_pTermReader->setFilter(m_pDeletedDocs);
m_pTermReader->open(pDirectory,name,pFieldInfo,m_pDeletedDocs);
break;
}
}
}
else
{
FIRTEX_THROW2(INDEX_COLLAPSE_ERROR,_T("the field number is 0."));
}
}