本文整理汇总了C++中wxArrayString::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ wxArrayString::clear方法的具体用法?C++ wxArrayString::clear怎么用?C++ wxArrayString::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxArrayString
的用法示例。
在下文中一共展示了wxArrayString::clear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSelections
void clTreeCtrlPanel::GetSelections(wxArrayString& folders,
wxArrayTreeItemIds& folderItems,
wxArrayString& files,
wxArrayTreeItemIds& fileItems)
{
folders.clear();
files.clear();
folderItems.clear();
fileItems.clear();
wxArrayTreeItemIds items;
if(GetTreeCtrl()->GetSelections(items)) {
for(size_t i = 0; i < items.size(); ++i) {
clTreeCtrlData* cd = GetItemData(items.Item(i));
if(cd) {
if(cd->IsFile()) {
files.Add(cd->GetPath());
fileItems.Add(items.Item(i));
} else if(cd->IsFolder()) {
folders.Add(cd->GetPath());
folderItems.Add(items.Item(i));
}
}
}
}
}
示例2: EnumCameras
bool GuideCamera::EnumCameras(wxArrayString& names, wxArrayString& ids)
{
names.clear();
names.push_back(wxString::Format(_("Camera %d"), 1));
ids.clear();
ids.push_back(DEFAULT_CAMERA_ID);
return false;
}
示例3: SetArguments
void wxCmdLineParserData::SetArguments(int argc, char **argv)
{
m_arguments.clear();
// Command-line arguments are supposed to be in the user locale encoding
// (what else?) but wxLocale probably wasn't initialized yet as we're
// called early during the program startup and so our locale might not have
// been set from the environment yet. To work around this problem we
// temporarily change the locale here. The only drawback is that changing
// the locale is thread-unsafe but precisely because we're called so early
// it's hopefully safe to assume that no other threads had been created yet.
char * const locOld = SetAllLocaleFacets("");
wxON_BLOCK_EXIT1( SetAllLocaleFacets, locOld );
for ( int n = 0; n < argc; n++ )
{
// try to interpret the string as being in the current locale
wxString arg(argv[n]);
// but just in case we guessed wrongly and the conversion failed, do
// try to salvage at least something
if ( arg.empty() && argv[n][0] != '\0' )
arg = wxString(argv[n], wxConvISO8859_1);
m_arguments.push_back(arg);
}
}
示例4: GetFiles
void SearchThread::GetFiles(const SearchData* data, wxArrayString& files)
{
std::set<wxString> scannedFiles;
const wxArrayString& rootDirs = data->GetRootDirs();
files = data->GetFiles();
// Remove files that do not match our search criteria
FilterFiles(files, data);
// Populate "scannedFiles" with list of files to scan
scannedFiles.insert(files.begin(), files.end());
for(size_t i = 0; i < rootDirs.size(); ++i) {
// make sure it's really a dir (not a fifo, etc.)
DirTraverser traverser(data->GetExtensions());
wxDir dir(rootDirs.Item(i));
dir.Traverse(traverser);
wxArrayString& someFiles = traverser.GetFiles();
for(size_t j = 0; j < someFiles.Count(); ++j) {
if(scannedFiles.count(someFiles.Item(j)) == 0) {
files.Add(someFiles.Item(j));
scannedFiles.insert(someFiles.Item(j));
}
}
}
files.clear();
std::for_each(scannedFiles.begin(), scannedFiles.end(), [&](const wxString& file) { files.Add(file); });
}
示例5: GetFiles
void SearchThread::GetFiles(const SearchData* data, wxArrayString& files)
{
wxStringSet_t scannedFiles;
const wxArrayString& rootDirs = data->GetRootDirs();
files = data->GetFiles();
// Populate "scannedFiles" with list of files to scan
scannedFiles.insert(files.begin(), files.end());
for(size_t i = 0; i < rootDirs.size(); ++i) {
// make sure it's really a dir (not a fifo, etc.)
clFilesScanner scanner;
std::vector<wxString> filesV;
if(scanner.Scan(rootDirs.Item(i), filesV, data->GetExtensions())) {
std::for_each(filesV.begin(), filesV.end(), [&](const wxString& file) { scannedFiles.insert(file); });
}
}
files.clear();
files.Alloc(scannedFiles.size());
std::for_each(scannedFiles.begin(), scannedFiles.end(), [&](const wxString& file) { files.Add(file); });
// Filter all non matching files
FilterFiles(files, data);
}
示例6: SetArguments
void wxCmdLineParserData::SetArguments(int argc, wxChar **argv)
{
m_arguments.clear();
for ( int n = 0; n < argc; n++ )
{
m_arguments.push_back(argv[n]);
}
}
示例7: GetWorkspaceFiles
void PHPWorkspace::GetWorkspaceFiles(wxArrayString& workspaceFiles, wxProgressDialog* progress) const
{
wxStringSet_t files;
GetWorkspaceFiles(files, progress);
workspaceFiles.clear();
wxStringSet_t::const_iterator iter = files.begin();
for(; iter != files.end(); ++iter) {
workspaceFiles.Add(*iter);
}
}
示例8: GetSideList
void tcScenarioDialog::GetSideList(wxArrayString& sideList)
{
sideList.clear();
for (size_t n=0; n<countrySelection.size(); n++)
{
wxString s = countrySelection[n]->GetValue();
if (s.size() > 0) sideList.push_back(s);
}
}
示例9: GetPaths
void wxGenericDirCtrl::GetPaths(wxArrayString& paths) const
{
paths.clear();
wxArrayTreeItemIds items;
m_treeCtrl->GetSelections(items);
for ( unsigned n = 0; n < items.size(); n++ )
{
wxTreeItemId treeid = items[n];
paths.push_back(GetPath(treeid));
}
}
示例10: GetPaths
void wxGenericDirCtrl::GetPaths(wxArrayString& paths) const
{
paths.clear();
wxArrayTreeItemIds items;
m_treeCtrl->GetSelections(items);
for ( unsigned n = 0; n < items.size(); n++ )
{
wxTreeItemId treeid = items[n];
wxDirItemData* data = (wxDirItemData*) m_treeCtrl->GetItemData(treeid);
paths.Add(data->m_path);
}
}
示例11: GetPinnedProjects
size_t LocalWorkspace::GetPinnedProjects(wxArrayString& projects)
{
projects.clear();
if(!SanityCheck()) { return 0; }
wxXmlNode* node = XmlUtils::FindFirstByTagName(m_doc.GetRoot(), "PinnedProjects");
if(!node) return 0;
// Read all projects
wxXmlNode* child = node->GetChildren();
while(child) {
if(child->GetName() == "Project") { projects.Add(child->GetAttribute("Name")); }
child = child->GetNext();
}
return projects.size();
}
示例12: getValue
bool Config::getValue(const wxString& key, wxArrayString& value)
{
wxString s;
if (!getValue(key, s))
return false;
value.clear();
wxString item;
size_t pos = 0, sep = s.find(',');
while (sep != wxString::npos)
{
item = s.substr(pos, sep - pos);
if (!item.empty())
value.push_back(item);
sep = s.find(',', pos = sep + 1);
}
if (!(item = s.substr(pos)).empty())
value.push_back(item);
return true;
}
示例13: fn
void
wxGenericFileCtrl::DoGetFilenames(wxArrayString& filenames, bool fullPath) const
{
filenames.clear();
const wxString dir = m_list->GetDir();
const wxString value = m_text->GetValue();
if ( !value.empty() )
{
wxFileName fn(value);
if ( fn.IsRelative() )
fn.MakeAbsolute(dir);
filenames.push_back(GetFileNameOrPath(fn, fullPath));
return;
}
const int numSel = m_list->GetSelectedItemCount();
if ( !numSel )
return;
filenames.reserve(numSel);
wxListItem item;
item.m_mask = wxLIST_MASK_TEXT;
item.m_itemId = -1;
for ( ;; )
{
item.m_itemId = m_list->GetNextItem(item.m_itemId, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED);
if ( item.m_itemId == -1 )
break;
m_list->GetItem(item);
const wxFileName fn(dir, item.m_text);
filenames.push_back(GetFileNameOrPath(fn, fullPath));
}
}
示例14: wxSplitPath
// this function is used to properly interpret '..' in path
void wxSplitPath(wxArrayString& aParts, const wxString& path)
{
aParts.clear();
wxString strCurrent;
wxString::const_iterator pc = path.begin();
for ( ;; ) {
if ( pc == path.end() || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == wxT(".") ) {
// ignore
}
else if ( strCurrent == wxT("..") ) {
// go up one level
if ( aParts.size() == 0 )
{
wxLogWarning(_("'%s' has extra '..', ignored."), path);
}
else
{
aParts.erase(aParts.end() - 1);
}
strCurrent.Empty();
}
else if ( !strCurrent.empty() ) {
aParts.push_back(strCurrent);
strCurrent.Empty();
}
//else:
// could log an error here, but we prefer to ignore extra '/'
if ( pc == path.end() )
break;
}
else
strCurrent += *pc;
++pc;
}
}
示例15: wxSplitPath
// this function is used to properly interpret '..' in path
void wxSplitPath(wxArrayString& aParts, const wxChar *sz)
{
aParts.clear();
wxString strCurrent;
const wxChar *pc = sz;
for ( ;; ) {
if ( *pc == wxT('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
if ( strCurrent == wxT(".") ) {
// ignore
}
else if ( strCurrent == wxT("..") ) {
// go up one level
if ( aParts.size() == 0 )
wxLogWarning(_("'%s' has extra '..', ignored."), sz);
else
aParts.erase(aParts.end() - 1);
strCurrent.Empty();
}
else if ( !strCurrent.empty() ) {
aParts.push_back(strCurrent);
strCurrent.Empty();
}
//else:
// could log an error here, but we prefer to ignore extra '/'
if ( *pc == wxT('\0') )
break;
}
else
strCurrent += *pc;
pc++;
}
}