本文整理汇总了C++中leditor::Vec_t::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Vec_t::begin方法的具体用法?C++ Vec_t::begin怎么用?C++ Vec_t::begin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类leditor::Vec_t
的用法示例。
在下文中一共展示了Vec_t::begin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAllEditors
size_t PluginManager::GetAllEditors(IEditor::List_t& editors, bool inOrder)
{
LEditor::Vec_t tmpEditors;
size_t flags = MainBook::kGetAll_IncludeDetached;
if(inOrder) {
flags |= MainBook::kGetAll_RetainOrder;
}
clMainFrame::Get()->GetMainBook()->GetAllEditors(tmpEditors, flags);
editors.insert(editors.end(), tmpEditors.begin(), tmpEditors.end());
return editors.size();
}
示例2: OnSearchEnded
void FindResultsTab::OnSearchEnded(wxCommandEvent& e)
{
m_searchInProgress = false;
SearchSummary* summary = (SearchSummary*)e.GetClientData();
if(!summary) return;
// did the page closed before the search ended?
AppendText(summary->GetMessage() + wxT("\n"));
if(m_tb->GetToolToggled(XRCID("scroll_on_output"))) {
m_sci->GotoLine(0);
}
if(!EditorConfigST::Get()->GetOptions()->GetDontAutoFoldResults()) {
OutputTabWindow::OnCollapseAll(e);
// Uncollapse the first file's matches
int maxLine = m_sci->GetLineCount();
for(int line = 0; line < maxLine; line++) {
int foldLevel = (m_sci->GetFoldLevel(line) & wxSTC_FOLDLEVELNUMBERMASK) - wxSTC_FOLDLEVELBASE;
if(foldLevel == 2 && !m_sci->GetFoldExpanded(line)) {
m_sci->ToggleFold(line);
break;
}
}
}
delete summary;
SaveSearchData();
// We need to tell all editors that there's been a (new) search
// This lets them clear any already-saved line-changes,
// which a new save will have taken into account
LEditor::Vec_t editors;
clMainFrame::Get()->GetMainBook()->GetAllEditors(editors, MainBook::kGetAll_IncludeDetached);
for(size_t n = 0; n < editors.size(); ++n) {
LEditor* editor = dynamic_cast<LEditor*>(*(editors.begin() + n));
if(editor) {
editor->OnFindInFiles();
}
}
}
示例3: ReloadExternallyModified
void MainBook::ReloadExternallyModified(bool prompt)
{
if(m_isWorkspaceReloading) return;
static int depth = wxNOT_FOUND;
++depth;
// Protect against recursion
if(depth == 2) {
depth = wxNOT_FOUND;
return;
}
LEditor::Vec_t editors;
GetAllEditors(editors, MainBook::kGetAll_IncludeDetached);
time_t workspaceModifiedTimeBefore = clCxxWorkspaceST::Get()->GetFileLastModifiedTime();
// filter list of editors for any whose files have been modified
std::vector<std::pair<wxFileName, bool> > files;
size_t n = 0;
for(size_t i = 0; i < editors.size(); i++) {
time_t diskTime = editors[i]->GetFileLastModifiedTime();
time_t editTime = editors[i]->GetEditorLastModifiedTime();
if(diskTime != editTime) {
// update editor last mod time so that we don't keep bugging the user over the same file,
// unless it gets changed again
editors[i]->SetEditorLastModifiedTime(diskTime);
// A last check: see if the content of the file has actually changed. This avoids unnecessary reload offers
// after e.g. git stash
if(!CompareFileWithString(editors[i]->GetFileName().GetFullPath(), editors[i]->GetText())) {
files.push_back(std::make_pair(editors[i]->GetFileName(), !editors[i]->GetModify()));
editors[n++] = editors[i];
}
}
}
editors.resize(n);
if(n == 0) return;
if(prompt) {
int res = clConfig::Get().GetAnnoyingDlgAnswer("FilesModifiedDlg", wxNOT_FOUND);
if(res == wxID_CANCEL) {
return; // User had previous ticked the 'Remember my answer' checkbox after he'd just chosen Ignore
}
if(res == wxNOT_FOUND) {
// User hasn't previously ticked the 'Remember my answer' checkbox
// Show the dialog
res = GetFilesModifiedDlg()->ShowModal();
if(GetFilesModifiedDlg()->GetRememberMyAnswer()) {
clConfig::Get().SetAnnoyingDlgAnswer("FilesModifiedDlg", res);
}
if(res == FilesModifiedDlg::kID_BUTTON_IGNORE) {
return;
}
}
if(res == FilesModifiedDlg::kID_BUTTON_CHOOSE) {
UserSelectFiles(files, _("Reload Modified Files"),
_("Files have been modified outside the editor.\nChoose which files you would like to reload."), false);
}
}
time_t workspaceModifiedTimeAfter = clCxxWorkspaceST::Get()->GetFileLastModifiedTime();
if(workspaceModifiedTimeBefore != workspaceModifiedTimeAfter) {
// a workspace reload occured between the "Reload Modified Files" and
// the "Reload WOrkspace" dialog, cancel this it's not needed anymore
return;
}
// See issue: https://github.com/eranif/codelite/issues/663
LEditor::Vec_t editorsAgain;
GetAllEditors(editorsAgain, MainBook::kGetAll_IncludeDetached);
// Make sure that the tabs that we have opened
// are still available in the main book
LEditor::Vec_t realEditorsList;
std::sort(editors.begin(), editors.end());
std::sort(editorsAgain.begin(), editorsAgain.end());
std::set_intersection(
editorsAgain.begin(), editorsAgain.end(), editors.begin(), editors.end(), std::back_inserter(realEditorsList));
// Update the "files" list
if(editors.size() != realEditorsList.size()) {
// something went wrong here...
CallAfter(&MainBook::ReloadExternallyModified, prompt);
return;
}
// reset the recursive protector
depth = wxNOT_FOUND;
std::vector<wxFileName> filesToRetag;
for(size_t i = 0; i < files.size(); i++) {
if(files[i].second) {
editors[i]->ReloadFile();
filesToRetag.push_back(files[i].first);
//.........这里部分代码省略.........