本文整理汇总了C++中FactoryResource::getFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ FactoryResource::getFileName方法的具体用法?C++ FactoryResource::getFileName怎么用?C++ FactoryResource::getFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FactoryResource
的用法示例。
在下文中一共展示了FactoryResource::getFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readHeader
bool LandsatEtmPlusImporter::readHeader(const string& strInFstHeaderFileName)
{
if (strInFstHeaderFileName.empty())
{
return false;
}
//The HTM header file contains information for Band 6 Channel 1 and 2.
//This set extracts the info needed to process HTM(band 6) header
mFieldHTM.clear();
string baseFileName = strInFstHeaderFileName.substr(0, strInFstHeaderFileName.length() - 7);
FactoryResource<Filename> filename;
filename->setFullPathAndName(baseFileName);
FactoryResource<FileFinder> fileFinder;
string htmFileName = filename->getFileName() + "HTM.FST";
if (fileFinder->findFile(filename->getPath(), htmFileName))
{
fileFinder->findNextFile();
fileFinder->getFullPath(htmFileName);
}
LargeFileResource htmFile;
if (htmFile.open(htmFileName, O_RDONLY, S_IREAD))
{
//process HTM header
vector<char> buf(5120);
size_t count = static_cast<size_t>(htmFile.read(&buf.front(), 5120));
VERIFY(htmFile.eof());
string htmHeaderFull(&buf.front(), count);
vector<string> htmHeaderLines = StringUtilities::split(htmHeaderFull, '\n');
if (!parseHeader(htmHeaderLines, mFieldHTM)) //parse band 6 header
{
mFieldHTM.clear();
}
}
htmFile.close();
// The HRF Header file contains the parameters for Bands 1-5 and 7.
mFieldHRF.clear();
string hrfFileName = filename->getFileName() + "HRF.FST";
if (fileFinder->findFile(filename->getPath(), hrfFileName))
{
fileFinder->findNextFile();
fileFinder->getFullPath(hrfFileName);
}
LargeFileResource hrfFile;
if (hrfFile.open(hrfFileName, O_RDONLY, S_IREAD))
{
//process HRF header
vector<char> buf(5120);
size_t count = static_cast<size_t>(hrfFile.read(&buf.front(), 5120));
VERIFY(hrfFile.eof());
string hrfHeaderFull(&buf.front(), count);
vector<string> hrfHeaderLines = StringUtilities::split(hrfHeaderFull, '\n');
if (!parseHeader(hrfHeaderLines, mFieldHRF)) //parse bands 1-5 and 7 header
{
mFieldHRF.clear();
}
}
hrfFile.close();
// The HPN Header file contains the parameters for Band 8.
mFieldHPN.clear();
string hpnFileName = filename->getFileName() + "HPN.FST";
if (fileFinder->findFile(filename->getPath(), hpnFileName))
{
fileFinder->findNextFile();
fileFinder->getFullPath(hpnFileName);
}
LargeFileResource hpnFile;
if (hpnFile.open(hpnFileName, O_RDONLY, S_IREAD))
{
//process HPN header
vector<char> buf(5120);
size_t count = static_cast<size_t>(hpnFile.read(&buf.front(), 5120));
VERIFY(hpnFile.eof());
string hpnHeaderFull(&buf.front(), count);
vector<string> hpnHeaderLines = StringUtilities::split(hpnHeaderFull, '\n');
if (!parseHeader(hpnHeaderLines, mFieldHPN)) //parse band 8 header
{
mFieldHPN.clear();
}
}
hpnFile.close();
return (!mFieldHRF.empty() || !mFieldHTM.empty() || !mFieldHPN.empty());
}