本文整理汇总了C++中ossimFilename::createDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ ossimFilename::createDirectory方法的具体用法?C++ ossimFilename::createDirectory怎么用?C++ ossimFilename::createDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ossimFilename
的用法示例。
在下文中一共展示了ossimFilename::createDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeDotRpfFiles
// Note: throws ossimException on error.
void ossimRpfUtil::writeDotRpfFiles( const ossimFilename& aDotTocFile,
const ossimFilename& outputDir )
{
static const char MODULE[] = "ossimRpfUtil::writeDotRpfFiles";
if ( traceDebug() )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered..."
<< "\na.toc file: " << aDotTocFile
<< "\noutput directory: " << outputDir
<< "\n";
}
// Parse the a.toc file:
ossimRefPtr<ossimRpfToc> toc = new ossimRpfToc();
if ( toc->parseFile(aDotTocFile) != ossimErrorCodes::OSSIM_OK )
{
std::string e = MODULE;
e += " ERROR:\nCould not open: ";
e+= aDotTocFile.string();
throw ossimException(e);
}
if ( outputDir.expand().exists() == false )
{
if ( !outputDir.createDirectory(true, 0775) )
{
std::string e = MODULE;
e += " ERROR:\nCould not create directory: ";
e+= outputDir.c_str();
throw ossimException(e);
}
}
//---
// Go through the entries...
//---
ossim_uint32 entries = toc->getNumberOfEntries();
for (ossim_uint32 entry = 0; entry < entries; ++entry)
{
const ossimRpfTocEntry* tocEntry = toc->getTocEntry(entry);
if (tocEntry)
{
if ( tocEntry->isEmpty() == false )
{
writeDotRpfFile(toc.get(), tocEntry, outputDir, entry);
}
}
else
{
std::string e = MODULE;
e += " ERROR: Null entry: ";
e += ossimString::toString(entry).string();
throw ossimException(e);
}
}
} // End: ossimRpfUtil::writeDotRpfFiles
示例2: createTocAndCopyFrames
void ossimRpfToc::createTocAndCopyFrames( const ossimFilename& dotRpfFile,
const ossimFilename& outputDir )
{
static const char MODULE[] = "ossimRpfToc::createTocAndCopyFrames";
if ( traceDebug() )
{
ossimNotify(ossimNotifyLevel_DEBUG)
<< MODULE << " entered..."
<< "\ndot rpf file: " << dotRpfFile
<< "\noutput directory: " << outputDir
<< "\n";
}
if ( outputDir.expand().exists() == false )
{
if ( !outputDir.createDirectory(true, 0775) )
{
std::string e = MODULE;
e += " ERROR:\nCould not create directory: ";
e+= outputDir.c_str();
throw ossimException(e);
}
}
// Open the dot rpf file.
std::ifstream* dotRpfStr = new std::ifstream;
dotRpfStr->open(dotRpfFile, ios_base::in);
if ( !dotRpfStr->good() )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not open: ";
e += dotRpfFile.c_str();
throw ossimException(e);
}
ossimFilename sourceADotTocFile = getSourceTocFile(*dotRpfStr);
if ( sourceADotTocFile.empty() )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not deduce source a.toc file!";
throw ossimException(e);
}
// Open the source a.toc file. Note the true flag is to keep the file header.
ossimRefPtr<ossimRpfToc> sourceADotToc = new ossimRpfToc;
if ( sourceADotToc->parseFile(sourceADotTocFile, true) != ossimErrorCodes::OSSIM_OK )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not open: ";
e += sourceADotTocFile.c_str();
throw ossimException(e);
}
ossimRefPtr<const ossimNitfFileHeader> sourceNitfFileHdr = sourceADotToc->getNitfFileHeader();
if ( !sourceNitfFileHdr.valid() )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not get nitf file header from: ";
e += sourceADotTocFile.c_str();
throw ossimException(e);
}
ossimRefPtr<const ossimRpfHeader> sourceRpfHdr = sourceADotToc->getRpfHeader();
if ( !sourceRpfHdr.valid() )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not get rpf header from: ";
e += sourceADotTocFile.c_str();
throw ossimException(e);
}
// Get the boundary rect sub header from the source a.toc.
ossimRefPtr<ossimRpfBoundaryRectSectionSubheader> boundaryRectSectionSubheader =
sourceRpfHdr->getNewBoundaryRectSectSubheader(sourceADotTocFile);
if ( !boundaryRectSectionSubheader.valid() )
{
delete dotRpfStr;
dotRpfStr = 0;
std::string e = MODULE;
e += " ERROR:\nCould not pull boundary rect sub header from source file: ";
e += sourceADotTocFile.c_str();
throw ossimException(e);
}
//.........这里部分代码省略.........