Android Open Source - codemap Cscope Entry






From Project

Back to project page codemap.

License

The source code is released under:

GNU General Public License

If you think the Android project codemap listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.hdweiss.codemap.data;
/* ww w .  j a va  2s.  co m*/
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class CscopeEntry {
  private static int CSCOPE_FILE = 1;
  private static int CSCOPE_ACTUALNAME = 2;
  private static int CSCOPE_NAME = 4;
  private static int CSCOPE_LINENUMBER = 3;
  
  public String actualName = "";
  public String name = "";
  public String file = "";
  public int lineNumber = -1;
  private int endLine = -2;
  
  private static Pattern CscopeEntryPattern = Pattern.compile("(\\S*)\\s(\\S*)\\s(\\d*)\\s(.*)");
  public CscopeEntry(String line) {
    Matcher matcher = CscopeEntryPattern.matcher(line);
    
    if(matcher.find()) {
      this.file = matcher.group(CSCOPE_FILE);
      this.name = matcher.group(CSCOPE_NAME);
      this.actualName = matcher.group(CSCOPE_ACTUALNAME);
      this.lineNumber = Integer.parseInt(matcher.group(CSCOPE_LINENUMBER));
    } else
      throw new IllegalArgumentException("Couldn't parse " + line);
  }
  
  public int getEndLine(CscopeWrapper cscopeWrapper) {
    if (endLine == -2)
      endLine = cscopeWrapper.getFunctionEndLine(this);
    return endLine;
  }
  
  public String getUrl(String projectPath) {
    if (file.length() > projectPath.length()) {
      String relativeFilename = file.substring(projectPath.length() + 1);
      return relativeFilename + ":" + name;
    } else
      return file + ":" + name;
  }
  
  public String getActualUrl(String projectPath) {
    if (file.length() > projectPath.length()) {
      String relativeFilename = file.substring(projectPath.length() + 1);
      return relativeFilename + ":" + actualName;
    } else
      return file + ":" + actualName;
  }
  
  public String toString() {
    return file + ":" + name + "@" + lineNumber;
  }
}




Java Source Code List

com.hdweiss.codemap.data.CodeMapApp.java
com.hdweiss.codemap.data.CscopeEntry.java
com.hdweiss.codemap.data.CscopeWrapper.java
com.hdweiss.codemap.data.Cscope.java
com.hdweiss.codemap.data.ICodeMapItem.java
com.hdweiss.codemap.data.JGitWrapper.java
com.hdweiss.codemap.data.ProjectController.java
com.hdweiss.codemap.data.Project.java
com.hdweiss.codemap.data.SerializableItem.java
com.hdweiss.codemap.data.SerializableLink.java
com.hdweiss.codemap.util.AbsoluteLayout.java
com.hdweiss.codemap.util.CodeMapCursorPoint.java
com.hdweiss.codemap.util.CodeMapPoint.java
com.hdweiss.codemap.util.FlowLayout.java
com.hdweiss.codemap.util.ObjectSerializer.java
com.hdweiss.codemap.util.SpanUtils.java
com.hdweiss.codemap.util.SyntaxHighlighter.java
com.hdweiss.codemap.util.Utils.java
com.hdweiss.codemap.util.ZoomableAbsoluteLayout.java
com.hdweiss.codemap.util.ZoomableLinearLayout.java
com.hdweiss.codemap.view.CodeMapActivity.java
com.hdweiss.codemap.view.CodeMapTabListener.java
com.hdweiss.codemap.view.Preferences.java
com.hdweiss.codemap.view.project.ProjectAdapter.java
com.hdweiss.codemap.view.project.ProjectBrowser.java
com.hdweiss.codemap.view.project.ProjectItemView.java
com.hdweiss.codemap.view.project.ProjectWizard.java
com.hdweiss.codemap.view.workspace.CollisionManager.java
com.hdweiss.codemap.view.workspace.FindDeclarationTask.java
com.hdweiss.codemap.view.workspace.WorkspaceController.java
com.hdweiss.codemap.view.workspace.WorkspaceFragment.java
com.hdweiss.codemap.view.workspace.WorkspaceStateLoader.java
com.hdweiss.codemap.view.workspace.WorkspaceState.java
com.hdweiss.codemap.view.workspace.WorkspaceViewListeners.java
com.hdweiss.codemap.view.workspace.WorkspaceView.java
com.hdweiss.codemap.view.workspace.browser.WorkspaceBrowserAdapter.java
com.hdweiss.codemap.view.workspace.browser.WorkspaceBrowser.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapAnnotation.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapFunction.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapImage.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapItem.java
com.hdweiss.codemap.view.workspace.fragments.CodeMapLink.java
com.hdweiss.codemap.view.workspace.fragments.FunctionLinkSpan.java
com.hdweiss.codemap.view.workspace.outline.CscopeEntryAdapter.java
com.hdweiss.codemap.view.workspace.outline.OutlineAdapter.java
com.hdweiss.codemap.view.workspace.outline.OutlineBrowser.java
com.hdweiss.codemap.view.workspace.outline.OutlineItemComparator.java
com.hdweiss.codemap.view.workspace.outline.OutlineItemView.java
com.hdweiss.codemap.view.workspace.outline.OutlineItem.java