当前位置: 首页>>代码示例>>C++>>正文


C++ wxArrayString::Empty方法代码示例

本文整理汇总了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();
}
开发者ID:vadz,项目名称:mahogany,代码行数:31,代码来源:AdbModule.cpp

示例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();
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:28,代码来源:mimetype.cpp

示例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 );
    }
}
开发者ID:BackupTheBerlios,项目名称:wxbeos-svn,代码行数:32,代码来源:filedlgg.cpp

示例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
}
开发者ID:Joeywp,项目名称:OVLMake,代码行数:26,代码来源:filedlgg.cpp

示例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]);
    }
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:26,代码来源:filedlgwce.cpp

示例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;
}
开发者ID:anatooly,项目名称:codelite,代码行数:12,代码来源:tabgroupmanager.cpp

示例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;
}
开发者ID:muhkuh-sys,项目名称:muhkuh_old,代码行数:39,代码来源:romloader_openocd_main.cpp

示例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;
}
开发者ID:vdm113,项目名称:wxWidgets-ICC-patch,代码行数:49,代码来源:mimetype.cpp

示例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;
    }
}
开发者ID:Kaoswerk,项目名称:newton-dynamics,代码行数:16,代码来源:mimetype.cpp

示例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
开发者ID:Duion,项目名称:Torsion,代码行数:16,代码来源:filedlg.cpp

示例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();
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:19,代码来源:mimetype.cpp

示例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() );
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:20,代码来源:filectrl.cpp

示例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() );
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:20,代码来源:filectrl.cpp

示例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;
}
开发者ID:Annovae,项目名称:Dolphin-Core,代码行数:40,代码来源:mimetype.cpp

示例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 );
   }
}
开发者ID:DavidBailes,项目名称:audacity,代码行数:22,代码来源:FileDialogPrivate.cpp


注:本文中的wxArrayString::Empty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。