// ---------------------------------------------------------------------------- void ProjectData::DumpBrowse_Marks( const wxString hashType ) // ---------------------------------------------------------------------------- { #if defined(LOGGING) LOGIT( _T("--- DumpBrowseData ---[%s]"), hashType.c_str() ); FileBrowse_MarksHash* phash = &m_FileBrowse_MarksArchive; if ( hashType == wxT("BookMarks") ) phash = &m_FileBook_MarksArchive; FileBrowse_MarksHash& hash = *phash; LOGIT( _T("Dump_%s Size[%d]"), hashType.c_str(), hash.size() ); for (FileBrowse_MarksHash::iterator it = hash.begin(); it != hash.end(); ++it) { wxString filename = it->first; BrowseMarks* p = it->second; LOGIT( _T("Filename[%s]%s*[%p]name[%s]"), filename.c_str(), hashType.c_str(), p, p->GetFilePath().c_str() ); if (p) { //dump the browse marks p->Dump(); } } #endif }
// ---------------------------------------------------------------------------- void ProjectData::DumpHash( const wxString #if defined(LOGGING) hashType #endif ) // ---------------------------------------------------------------------------- { #if defined(LOGGING) FileBrowse_MarksHash* phash = &m_FileBrowse_MarksArchive; if ( hashType == wxT("BookMarks") ) phash = &m_FileBook_MarksArchive; FileBrowse_MarksHash& hash = *phash; LOGIT( _T("--- DumpProjectHash ---[%s]Count[%d]"), hashType.c_str(), hash.size(), m_ProjectFilename.c_str() ); for (FileBrowse_MarksHash::iterator it = hash.begin(); it != hash.end(); it++) { wxString filename = it->first; //an Editor filename withing this project BrowseMarks* p = it->second; // ptr to array of Editor Browse/Book mark cursor positions LOGIT( _T("filename[%s]BrowseMark*[%p]name[%s]"), filename.c_str(), p, p->GetFilePath().c_str() ); } #endif }
// ---------------------------------------------------------------------------- BrowseMarks* ProjectData::GetPointerToBrowse_MarksArray(FileBrowse_MarksHash& hash, wxString filePath) // ---------------------------------------------------------------------------- { // Return a pointer to a BrowseMarks array with this filePath for (FileBrowse_MarksHash::iterator it = hash.begin(); it != hash.end(); it++) { BrowseMarks* p = it->second; if ( p->GetFilePath() == filePath ) {return p;} } return 0; }
// ---------------------------------------------------------------------------- void BrowseMarks::RecordMarksFrom(BrowseMarks& otherBrowse_Marks) // ---------------------------------------------------------------------------- { // get editor by filename in case the editor was close/opened again //-EditorBase* eb = m_pEditorBase; EditorBase* eb = m_pEdMgr->GetEditor(m_filePath); #if defined(LOGGING) if (not eb) asm("int3"); /*trap*/ #endif if (not eb) return; cbEditor* cbed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(eb); if (not cbed) return; cbStyledTextCtrl* control = cbed->GetControl(); for (int i=0; i<MaxEntries; ++i) { int posn = otherBrowse_Marks.GetMark(i); if ( posn != -1 ) { #if defined(LOGGING) ///LOGIT( _T("RecordMarksFrom for[%d][%d]"),i,posn ); #endif RecordMark( posn ); int line = control->LineFromPosition(posn); //-control->MarkerAdd(line, BROWSETRACKER_MARKER); control->MarkerAdd(line, GetBrowseMarkerId()); } } }
// ---------------------------------------------------------------------------- bool BrowseTrackerLayout::ParseBrowse_MarksString(const wxString& filename, wxString BrowseMarksString, FileBrowse_MarksHash& m_EdMarksArchive) // ---------------------------------------------------------------------------- { if (filename.IsEmpty()) return false; if ( BrowseMarksString.IsEmpty() ) return false; ProjectFile* pf = m_pProject->GetFileByFilename( filename, true, true); if ( not pf ) return false; wxString filenamePath = pf->file.GetFullPath(); // parse the comma delimited string BrowseMarks* pEdPosnArchive = new BrowseMarks(filenamePath ); wxStringTokenizer tkz(BrowseMarksString, wxT(",")); while ( tkz.HasMoreTokens() ) { long longnum; tkz.GetNextToken().ToLong(&longnum); pEdPosnArchive->RecordMark(longnum); }//while m_EdMarksArchive[filenamePath] = pEdPosnArchive; return true; }//ParseBrowse_MarksString
void BrowseTrackerLayout::DumpBrowse_Marks( const wxString /*hashType*/, FileBrowse_MarksHash& /*m_FileBrowse_MarksArchive*/ ) #endif // ---------------------------------------------------------------------------- { #if defined(LOGGING) LOGIT( _T("--- DumpBrowseData ---[%s]"), hashType.c_str() ); FileBrowse_MarksHash* phash = &m_FileBrowse_MarksArchive; #if defined(LOGGING) LOGIT( _T("Dump_%s Size[%lu]"), hashType.wx_str(), static_cast<unsigned long>(phash->size()) ); #endif for (FileBrowse_MarksHash::iterator it = phash->begin(); it != phash->end(); ++it) { wxString filename = it->first; BrowseMarks* p = it->second; LOGIT( _T("Filename[%s]%s*[%p]name[%s]"), filename.c_str(), hashType.c_str(), p, p->GetFilePath().c_str() ); if (p) { //dump the browse marks p->Dump(); } } #endif }