本文整理汇总了C++中wxArrayString::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayString::Empty方法的具体用法?C++ wxArrayString::Empty怎么用?C++ wxArrayString::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayString
的用法示例。
在下文中一共展示了wxArrayString::Empty方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EnumModules
size_t AdbModule::EnumModules(const char *kind,
wxArrayString& names, wxArrayString& descs)
{
names.Empty();
descs.Empty();
AdbModule *importer = NULL;
AdbModule::AdbModuleInfo *info = AdbModule::GetAdbModuleInfo(kind);
while ( info )
{
importer = info->CreateModule();
if ( importer )
{
names.Add(importer->GetName());
descs.Add(importer->GetFormatDesc());
importer->DecRef();
importer = NULL;
}
else
{
wxLogDebug(_T("Failed to load ADB importer '%s'."), info->name.c_str());
}
info = info->next;
}
FreeAdbModuleInfo(info);
return names.GetCount();
}
示例2: EnumAllFileTypes
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
{
InitIfNeeded();
mimetypes.Empty();
size_t count = m_aTypes.GetCount();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for ( size_t n = 0; n < count; n++ )
{
// don't return template types from here (i.e. anything containg '*')
const wxString &type = m_aTypes[n];
if ( type.Find(wxT('*')) == wxNOT_FOUND )
{
mimetypes.Add(type);
}
}
return mimetypes.GetCount();
}
示例3: GetPaths
void wxGenericFileDialog::GetPaths( wxArrayString& paths ) const
{
paths.Empty();
if (m_list->GetSelectedItemCount() == 0)
{
paths.Add( GetPath() );
return;
}
paths.Alloc( m_list->GetSelectedItemCount() );
wxString dir = m_list->GetDir();
#ifdef __UNIX__
if (dir != wxT("/"))
#endif
#ifdef __WXWINCE__
if (dir != wxT("/") && dir != wxT("\\"))
#endif
dir += wxFILE_SEP_PATH;
wxListItem item;
item.m_mask = wxLIST_MASK_TEXT;
item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
while ( item.m_itemId != -1 )
{
m_list->GetItem( item );
paths.Add( dir + item.m_text );
item.m_itemId = m_list->GetNextItem( item.m_itemId,
wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
}
}
示例4: GetFilenames
void wxGenericFileDialog::GetFilenames(wxArrayString& files) const
{
#ifdef __WXGTK__
m_list->GetFilenames(files);
#else
files.Empty();
if (m_list->GetSelectedItemCount() == 0)
{
files.Add( GetFilename() );
return;
}
files.Alloc( m_list->GetSelectedItemCount() );
wxListItem item;
item.m_mask = wxLIST_MASK_TEXT;
item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
while ( item.m_itemId != -1 )
{
m_list->GetItem( item );
files.Add( item.m_text );
item.m_itemId = m_list->GetNextItem( item.m_itemId,
wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
}
#endif
}
示例5: GetPaths
void wxFileDialog::GetPaths(wxArrayString& paths) const
{
paths.Empty();
wxString dir(m_dir);
if ( m_dir.Last() != wxT('\\') )
dir += wxT('\\');
size_t count = m_fileNames.GetCount();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for ( size_t n = 0; n < count; n++ )
{
if (wxFileName(m_fileNames[n]).IsAbsolute())
paths.Add(m_fileNames[n]);
else
paths.Add(dir + m_fileNames[n]);
}
}
示例6: FindTabgroup
bool TabgroupManager::FindTabgroup(const wxString& tabgroupname, wxArrayString& items)
{
items.Empty();
vTabGrps::const_iterator iter = m_tabgroups.begin();
for(; iter != m_tabgroups.end(); ++iter) {
if(iter->first == tabgroupname) {
items = iter->second;
return true;
}
}
return false;
}
示例7: fn_init
int fn_init(wxLog *ptLogTarget, wxXmlNode *ptCfgNode, wxString &strPluginId)
{
wxLog *pOldLogTarget;
int iResult;
/* set main app's log target */
pOldLogTarget = wxLog::GetActiveTarget();
if( pOldLogTarget!=ptLogTarget )
{
wxLog::SetActiveTarget(ptLogTarget);
if( pOldLogTarget!=NULL )
{
delete pOldLogTarget;
}
}
/* say hi */
wxLogMessage(wxT("bootloader openocd plugin init: ") + strPluginId);
/* remember id */
plugin_desc.strPluginId = strPluginId;
/* init the lua state */
m_ptLuaState = NULL;
/* clear the command arrays */
astrInitCfg.Empty();
astrRunCfg.Empty();
/* read the config file */
iResult = readXmlTextArray(ptCfgNode, wxT("Init"), &astrInitCfg);
if( iResult==0 )
{
iResult = readXmlTextArray(ptCfgNode, wxT("Run"), &astrRunCfg);
}
return iResult;
}
示例8: GetExtensions
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
{
const wxString strExtensions = m_manager->GetExtension(m_index[0]);
extensions.Empty();
// one extension in the space or comma-delimited list
wxString strExt;
wxString::const_iterator end = strExtensions.end();
#if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */
# pragma ivdep
# pragma swp
# pragma unroll
# pragma prefetch
# if 0
# pragma simd noassert
# endif
#endif /* VDM auto patch */
for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p )
{
if ( p == end || *p == wxT(' ') || *p == wxT(',') )
{
if ( !strExt.empty() )
{
extensions.Add(strExt);
strExt.Empty();
}
//else: repeated spaces
// (shouldn't happen, but it's not that important if it does happen)
if ( p == end )
break;
}
else if ( *p == wxT('.') )
{
// remove the dot from extension (but only if it's the first char)
if ( !strExt.empty() )
{
strExt += wxT('.');
}
//else: no, don't append it
}
else
{
strExt += *p;
}
}
return true;
}
示例9: GetExtensions
// TODO this function is half implemented
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
{
if ( m_ext.empty() ) {
// the only way to get the list of extensions from the file type is to
// scan through all extensions in the registry - too slow...
return false;
}
else {
extensions.Empty();
extensions.Add(m_ext);
// it's a lie too, we don't return _all_ extensions...
return true;
}
}
示例10: GetPaths
void wxFileDialog::GetPaths (
wxArrayString& rasPaths
) const
{
wxString sDir(m_dir);
size_t nCount = m_fileNames.GetCount();
rasPaths.Empty();
if (m_dir.Last() != _T('\\'))
sDir += _T('\\');
for ( size_t n = 0; n < nCount; n++ )
{
rasPaths.Add(sDir + m_fileNames[n]);
}
} // end of wxFileDialog::GetPaths
示例11: EnumAllFileTypes
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
{
InitIfNeeded();
mimetypes.Empty();
size_t count = m_aTypes.GetCount();
for ( size_t n = 0; n < count; n++ )
{
// don't return template types from here (i.e. anything containg '*')
const wxString &type = m_aTypes[n];
if ( type.Find(wxT('*')) == wxNOT_FOUND )
{
mimetypes.Add(type);
}
}
return mimetypes.GetCount();
}
示例12: GetPaths
void wxGtkFileChooser::GetPaths( wxArrayString& paths ) const
{
paths.Empty();
if ( gtk_file_chooser_get_select_multiple( m_widget ) )
{
GSList *gpathsi = gtk_file_chooser_get_filenames( m_widget );
GSList *gpaths = gpathsi;
while ( gpathsi )
{
wxString file( wxConvFileName->cMB2WX( ( gchar* ) gpathsi->data ) );
paths.Add( file );
g_free( gpathsi->data );
gpathsi = gpathsi->next;
}
g_slist_free( gpaths );
}
else
paths.Add( GetPath() );
}
示例13: GetPaths
void wxGtkFileChooser::GetPaths( wxArrayString& paths ) const
{
paths.Empty();
if ( gtk_file_chooser_get_select_multiple( m_widget ) )
{
GSList *gpathsi = gtk_file_chooser_get_filenames( m_widget );
GSList *gpaths = gpathsi;
while ( gpathsi )
{
wxString file(wxString::FromUTF8(static_cast<gchar *>(gpathsi->data)));
paths.Add( file );
g_free( gpathsi->data );
gpathsi = gpathsi->next;
}
g_slist_free( gpaths );
}
else
paths.Add( GetPath() );
}
示例14: GetExtensions
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
{
const wxString strExtensions = m_manager->GetExtension(m_index[0]);
extensions.Empty();
// one extension in the space or comma-delimited list
wxString strExt;
wxString::const_iterator end = strExtensions.end();
for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p )
{
if ( p == end || *p == wxT(' ') || *p == wxT(',') )
{
if ( !strExt.empty() )
{
extensions.Add(strExt);
strExt.Empty();
}
//else: repeated spaces
// (shouldn't happen, but it's not that important if it does happen)
if ( p == end )
break;
}
else if ( *p == wxT('.') )
{
// remove the dot from extension (but only if it's the first char)
if ( !strExt.empty() )
{
strExt += wxT('.');
}
//else: no, don't append it
}
else
{
strExt += *p;
}
}
return true;
}
示例15: GetFilenames
void FILEDIALOG::GetFilenames(wxArrayString& files) const
{
files.Empty();
if (m_list->GetSelectedItemCount() == 0)
{
files.Add( GetFilename() );
return;
}
files.Alloc( m_list->GetSelectedItemCount() );
wxListItem item;
item.m_mask = wxLIST_MASK_TEXT;
item.m_itemId = m_list->GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
while ( item.m_itemId != -1 )
{
m_list->GetItem( item );
files.Add( item.m_text );
item.m_itemId = m_list->GetNextItem( item.m_itemId,
wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );
}
}