本文整理汇总了C++中wxFileName::HasName方法的典型用法代码示例。如果您正苦于以下问题:C++ wxFileName::HasName方法的具体用法?C++ wxFileName::HasName怎么用?C++ wxFileName::HasName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxFileName
的用法示例。
在下文中一共展示了wxFileName::HasName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WinPathToCygwin
wxString eDocumentPath::WinPathToCygwin(const wxFileName& path) {
wxASSERT(path.IsOk() && path.IsAbsolute());
#ifndef __WXMSW__
return path.GetFullPath();
#else
wxString fullpath = path.GetFullPath();
// Check if we have a foward-slash unc path; cygwin can handle these directly.
if (fullpath.StartsWith(wxT("//"))) {
return fullpath;
}
// Check if we have a backslash unc path; convert to forward slash and pass on.
if (fullpath.StartsWith(wxT("\\\\"))) {
fullpath.Replace(wxT("\\"), wxT("/"));
return fullpath;
}
// Convert C:\... to /cygdrive/c/...
wxString unixPath = eDocumentPath::s_cygdrivePrefix + path.GetVolume().Lower();
// Convert slashs in path segments
const wxArrayString& dirs = path.GetDirs();
for (unsigned int i = 0; i < dirs.GetCount(); ++i) {
unixPath += wxT('/') + dirs[i];
}
// Add the filename, if there is one
if (path.HasName()) unixPath += wxT('/') + path.GetFullName();
return unixPath;
#endif
}
示例2: WinPathToCygwin
wxString WinPathToCygwin(const wxFileName& path) { // static
wxASSERT(path.IsOk() && path.IsAbsolute());
// Drive
wxString unixPath = wxT("/cygdrive/");
unixPath += path.GetVolume().Lower();
// Dirs
const wxArrayString& dirs = path.GetDirs();
for (unsigned int i = 0; i < dirs.GetCount(); ++i) {
unixPath += wxT('/') + dirs[i];
}
// Filename
if (path.HasName()) {
unixPath += wxT('/') + path.GetFullName();
}
return unixPath;
}
示例3: Create_BOM_Lists
void DIALOG_BUILD_BOM::Create_BOM_Lists( int aTypeFile,
bool aIncludeSubComponents,
char aExportSeparatorSymbol,
bool aRunBrowser )
{
wxString wildcard;
static wxFileName fn;
wxFileName current = g_RootSheet->GetScreen()->GetFileName();
s_ExportSeparatorSymbol = aExportSeparatorSymbol;
if( !fn.HasName() || fn.GetName()==NAMELESS_PROJECT )
{
fn.SetName( current.GetName() );
}
// else use a previous run's name, because fn was set before and user
// is probably just iteratively refining the BOM.
if( fn.GetPath().IsEmpty() )
{
fn.SetPath( current.GetPath() );
}
// else use a previous run's path, because fn was set before and user
// is probably just iteratively refining the BOM.
wxString bomDesc = _( "Bill of Materials" ); // translate once, use twice.
if( aTypeFile == 0 )
{
fn.SetExt( wxT( "lst" ) );
wildcard = bomDesc + wxT( " (*.lst)|*.lst" );
}
else
{
fn.SetExt( wxT( "csv" ) );
wildcard = bomDesc + wxT( " (*.csv)|*.csv" );
}
wxFileDialog dlg( this, bomDesc, fn.GetPath(),
fn.GetFullName(), wildcard, wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL )
return;
fn = dlg.GetPath(); // remember path+filename+ext for subsequent runs.
m_listFileName = dlg.GetPath();
// Close dialog, then show the list (if so requested)
switch( aTypeFile )
{
case 0: // list
CreatePartsAndLabelsFullList( aIncludeSubComponents );
break;
case 1: // spreadsheet, Single Part per line
CreateSpreadSheetPartsFullList( aIncludeSubComponents, s_Add_Location, false );
break;
case 2: // spreadsheet, group Part with same fields per line
CreateSpreadSheetPartsFullList( aIncludeSubComponents, s_Add_Location, true );
break;
case 3: // spreadsheet, one value per line and no sub-component
CreateSpreadSheetPartsShortList();
break;
}
EndModal( 1 );
if( aRunBrowser )
{
wxString editorname = wxGetApp().GetEditorName();
wxString filename = m_listFileName;
AddDelimiterString( filename );
ExecuteFile( this, editorname, filename );
}
}