本文整理汇总了C++中readerwriter::WriteResult::success方法的典型用法代码示例。如果您正苦于以下问题:C++ WriteResult::success方法的具体用法?C++ WriteResult::success怎么用?C++ WriteResult::success使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类readerwriter::WriteResult
的用法示例。
在下文中一共展示了WriteResult::success方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeObject
ReaderWriter::WriteResult FileCache::writeObject(const osg::Object& object, const std::string& originalFileName, const osgDB::Options* options) const
{
std::string cacheFileName = createCacheFileName(originalFileName);
if (!cacheFileName.empty())
{
std::string path = osgDB::getFilePath(cacheFileName);
if (!osgDB::fileExists(path) && !osgDB::makeDirectory(path))
{
OSG_NOTICE<<"Could not create cache directory: "<<path<<std::endl;
return ReaderWriter::WriteResult::ERROR_IN_WRITING_FILE;
}
OSG_INFO<<"FileCache::writeObjectToCache("<<originalFileName<<") as "<<cacheFileName<<std::endl;
ReaderWriter::WriteResult result = osgDB::Registry::instance()->writeObject(object, cacheFileName, options);
if (result.success())
{
removeFileFromBlackListed(originalFileName);
}
return result;
}
return ReaderWriter::WriteResult::FILE_NOT_HANDLED;
}
示例2: writeScriptFile
bool osgDB::writeScriptFile(const Script& image,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeScript( image, filename, options );
if (wr.error()) OSG_WARN << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
示例3: writeShaderFile
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
{
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
if (!wr.success()) OSG_WARN << "Error writing file " << filename << ": " << wr.statusMessage() << std::endl;
return wr.success();
}