本文整理汇总了C++中openstudio::path::filename方法的典型用法代码示例。如果您正苦于以下问题:C++ path::filename方法的具体用法?C++ path::filename怎么用?C++ path::filename使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类openstudio::path
的用法示例。
在下文中一共展示了path::filename方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OSItem
ScriptItem::ScriptItem(const openstudio::path& path,
OSItemType type,
QWidget * parent)
: OSItem(scriptToItemId(path), type, parent),
m_removed(false),
m_scriptInfo(path, true, false)
{
setText(openstudio::toQString(path.filename()));
setLeftPixmap(QPixmap(":/images/icon_scripts.png"));
if (boost::regex_search(toString(itemId().sourceId()),boost::regex("resource"))) {
m_scriptInfo.isUserScript = false;
}
else {
try {
m_scriptInfo = runmanager::RubyJobBuilder::updateArgumentsFromDb(m_scriptInfo);
} catch (const runmanager::ScriptDetectionError &e) {
// Nothing to display here in the constructor
m_scriptInfo = e.scriptInfo;
}
}
std::shared_ptr<OSDocument> osDoc = OSAppBase::instance()->currentDocument();
connect(this, &ScriptItem::argChanged, osDoc.get(), &OSDocument::markAsModified);
}
示例2: addScriptToFolder
void ScriptFolderListView::addScriptToFolder(const openstudio::path &t_path, const openstudio::path& folder_name)
{
openstudio::path folder = m_rootPath / folder_name;
boost::filesystem::create_directories(folder);
openstudio::path filename = folder / t_path.filename();
filename = iterateFileName(filename);
boost::filesystem::copy_file(t_path, filename, boost::filesystem::copy_option::overwrite_if_exists);
ScriptsListView *lv = m_scriptsListViews[folder];
if (lv)
{
lv->updateData();
}
}
示例3: FileReferenceType
FileReference::FileReference(const openstudio::path& p)
: m_uuid(createUUID()),
m_versionUUID(createUUID()),
m_name(toString(p)),
m_displayName(toString(p.filename())),
m_path(completeAndNormalize(p)),
m_timestampLast(),
m_checksumCreate(checksum(m_path)),
m_checksumLast(m_checksumCreate)
{
try {
m_fileType = FileReferenceType(getFileExtension(p));
}
catch (...) {
m_fileType = FileReferenceType::Unknown;
}
update(openstudio::path());
}