1 package edu.uci.eecs.specExtraction;
5 * This class represents a qualified variable name in C++, e.g.
6 * Base::Mine::func. We use this class in the FunctionHeader class to represent
7 * the name of the function. However, for the sake of simplicity in usage, we
8 * only use it as a plain string with the bareName.
14 public class QualifiedName {
15 // The full name --- Base::Mine::func
16 public final String fullName;
17 // The bare name --- func
18 public final String bareName;
19 // The qualified name --- Base::Mine
20 public final String qualifiedName;
22 public QualifiedName(String fullName) {
23 this.fullName = fullName;
24 this.bareName = getBareName();
25 this.qualifiedName = getQualifiedName();
28 private String getBareName() {
30 beginIdx = fullName.lastIndexOf(':');
34 return fullName.substring(beginIdx + 1);
37 private String getQualifiedName() {
38 int endIdx = fullName.lastIndexOf(bareName);
41 return fullName.substring(0, endIdx);
44 public String toString() {
45 return fullName + "\n" + bareName;