本文整理汇总了C++中BoostPath::parent_path方法的典型用法代码示例。如果您正苦于以下问题:C++ BoostPath::parent_path方法的具体用法?C++ BoostPath::parent_path怎么用?C++ BoostPath::parent_path使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoostPath
的用法示例。
在下文中一共展示了BoostPath::parent_path方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeLogging
void MainApplication::initializeLogging(BoostPath KELogFilePath)
{
if(_EnableLogging)
{
//Configure the LogBuffer
osgLogP->setLogType(LOG_BUFFER, true);
//Configure the LogBuffer
osgLogP->getLogBuf().setEnabled(true);
osgLogP->getLogBuf().setCallback(KELogBufferCallback);
if(_LogToFile)
{
//Make sure the directory is created
try
{
boost::filesystem::create_directories(KELogFilePath.parent_path());
}
catch(std::exception& ex)
{
SWARNING << "Failed to create directory: " << KELogFilePath.parent_path()
<< ", error: " << ex.what() << std::endl;
return;
}
//If the Log is to a file then set the filev
_LogFile.open(KELogFilePath.string().c_str());
}
}
else
{
//Disable all logging
osgLogP->setLogType(LOG_NONE, true);
}
}
示例2: writeXML
OSG_BEGIN_NAMESPACE
/***************************************************************************\
* Class variables *
\***************************************************************************/
/***************************************************************************\
* Class methods *
\***************************************************************************/
/***************************************************************************\
* Instance methods *
\***************************************************************************/
bool ApplicationSettings::writeXML(const BoostPath& FilePath)
{
//Make sure the directory is created
try
{
boost::filesystem::create_directories(FilePath.parent_path());
}
catch(std::exception& ex)
{
SWARNING << "Failed to create directory: " << FilePath.parent_path()
<< ", error: " << ex.what() << std::endl;
return false;
}
//Write the XML
try
{
boost::property_tree::xml_parser::write_xml(FilePath.string(),
_PropertyTree,
std::locale(),
boost::property_tree::xml_parser::xml_writer_make_settings<boost::property_tree::ptree::key_type::value_type>(' ', 4));
}
catch(std::exception& ex)
{
SWARNING << "Failed to write settings to file: " << FilePath.string()
<< ", error: " << ex.what() << std::endl;
return false;
}
return true;
}
示例3: getParent
boost::any LuaGraphTreeModel::getParent(const boost::any& node) const
{
try
{
BoostPath ThePath = boost::any_cast<BoostPath>(node);
if((!ThePath.empty() ||
ThePath == getInternalRoot() ||
boost::filesystem::equivalent(ThePath, getInternalRoot())) &&
(boost::filesystem::exists(ThePath) && boost::filesystem::exists(getInternalRoot())))
{
return boost::any(ThePath.parent_path());
}
}
catch(boost::bad_any_cast &)
{
}
return boost::any();
}