本文整理汇总了C++中Directory::exist方法的典型用法代码示例。如果您正苦于以下问题:C++ Directory::exist方法的具体用法?C++ Directory::exist怎么用?C++ Directory::exist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Directory
的用法示例。
在下文中一共展示了Directory::exist方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Window
DlcFolderViewer::DlcFolderViewer(Widget* parent, Directory folder )
: Window( parent, Rect( Point(), parent->size() ), "", -1, bgNone ), _d( new Impl )
{
if( !folder.exist() )
return;
Window::setupUI( ":/gui/dlcviewer.gui" );
setWindowFlag( Window::fdraggable, false );
_d->init( size() );
_d->folder = folder;
Path configFile = folder/".info";
std::vector<Path> items;
if( configFile.exist() )
{
VariantList list = config::load( configFile.toString() ).get( "items" ).toList();
for( auto item : list )
{
items.push_back( folder/Path(item.toString()) );
}
}
else
{
vfs::Entries::Items entries = folder.entries().items();
for( auto item : entries )
{
if( _d->exclude.contains( item.name.toString() ) )
continue;
if( _d->available.contains( item.name.extension() ) )
items.push_back( item.fullpath );
}
}
_d->table = new Table( this, -1, Rect( 120, 50, width() - 40, height() - 50 ) );
_d->table->setDrawFlag( Table::drawColumns, false );
_d->table->setDrawFlag( Table::drawRows, false );
_d->table->setDrawFlag( Table::drawActiveCell, true );
_d->fillTable( items );
CONNECT( _d->table, onCellClicked(), this, DlcFolderViewer::_resolveCellClick )
PushButton* btn = new PushButton( this, Rect( Point( width() / 2 - 200, height() - 40 ), Size( 200, 24 ) ), "Open folder" );
CONNECT( btn, onClicked(), this, DlcFolderViewer::_openFolder )
btn = new PushButton( this, Rect( Point( width() / 2 + 2, height() - 40 ), Size( 200, 24 ) ), "Close" );
CONNECT( btn, onClicked(), this, DlcFolderViewer::deleteLater )
}