wxString TagEntry::GetReturnValue() const { wxString returnValue = GetExtField(_T("returns")); returnValue.Trim().Trim(false); returnValue.Replace(wxT("virtual"), wxT("")); return returnValue; }
wxString TagEntry::GetInheritsAsString() const { return GetExtField(_T("inherits")); }
void TagEntry::Create(const wxString& fileName, const wxString& name, int lineNumber, const wxString& pattern, const wxString& kind, std::map<wxString, wxString>& extFields) { m_isCommentForamtted = false; m_flags = 0; m_isClangTag = false; SetName(name); SetLine(lineNumber); SetKind(kind.IsEmpty() ? wxT("<unknown>") : kind); SetPattern(pattern); SetFile(fileName); SetId(-1); m_extFields = extFields; wxString path; // Check if we can get full name (including path) path = GetExtField(wxT("class")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("struct")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("namespace")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("interface")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("enum")); if(!path.IsEmpty()) { UpdatePath(path); } else { path = GetExtField(wxT("union")); wxString tmpname = path.AfterLast(wxT(':')); if(!path.IsEmpty()) { if(!tmpname.StartsWith(wxT("__anon"))) { UpdatePath(path); } else { // anonymouse union, remove the anonymous part from its name path = path.BeforeLast(wxT(':')); path = path.BeforeLast(wxT(':')); UpdatePath(path); } } } } } } } if(!path.IsEmpty()) { SetScope(path); } else { SetScope(wxT("<global>")); } // If there is no path, path is set to name if(GetPath().IsEmpty()) SetPath(GetName()); // Get the parent name StringTokenizer tok(GetPath(), wxT("::")); wxString parent; (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count() - 2]; SetParent(parent); }
void TagEntry::Create(const wxString &fileName, const wxString &name, int lineNumber, const wxString &pattern, const wxString &kind, std::map<wxString, wxString>& extFields) { SetPosition( wxNOT_FOUND ); SetName( name ); SetLine( lineNumber ); SetKind( kind.IsEmpty() ? wxT("<unknown>") : kind ); SetPattern( pattern ); SetFile( fileName ); SetId(-1); SetParentId(-1); m_extFields = extFields; wxString path; // Check if we can get full name (including path) path = GetExtField(wxT("class")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("struct")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("namespace")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("interface")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("enum")); if(!path.IsEmpty()) { UpdatePath( path ) ; } else { path = GetExtField(wxT("union")); if(!path.IsEmpty()) { UpdatePath( path ) ; } } } } } } if(!path.IsEmpty()) { SetScope(path); } else { SetScope(wxT("<global>")); } // If there is no path, path is set to name if( GetPath().IsEmpty() ) SetPath( GetName() ); // Get the parent name StringTokenizer tok(GetPath(), wxT("::")); wxString parent; (tok.Count() < 2) ? parent = wxT("<global>") : parent = tok[tok.Count()-2]; SetParent(parent); }