Class NamespacePath
- java.lang.Object
- 
- ghidra.app.util.bin.format.dwarf4.next.NamespacePath
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<NamespacePath>
 
 public class NamespacePath extends java.lang.Object implements java.lang.Comparable<NamespacePath> Represents a hierarchical path of containers that hold names of objects.Each container of names (lets call them a namespace for short) can have a type that distinguishes it from other containers: classes, functions, c++ namespaces, etc. A NamespacePath does not correlate directly to a Ghidra Namespace, as a Ghidra Namespace is tied to a Program and has rules about what can be placed inside of it.NamespacePath instances can be created without referring to a Ghidra Program and without concern as to what will be valid or have collisions. Use a NamespacePath to represent and hold forward-engineering namespace nesting information (ie. namespace info recovered from debug info), and when a Ghidra Namespace is needed, convert to or lookup the live/'real' Ghidra Namespace. 
- 
- 
Field SummaryFields Modifier and Type Field Description static NamespacePathROOT
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringasFormattedString()Converts this namespace path into aNamespacestyle string without the ROOT namespace included.java.lang.StringasNamespaceString()Converts this namespace path into aNamespacestyle string.intcompareTo(NamespacePath otherPath)static NamespacePathcreate(NamespacePath parent, java.lang.String name, SymbolType type)Creates a newNamespacePathinstance.booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the name of this namespace element, ie.NamespacegetNamespace(Program program)NamespacePathgetParent()Returns a reference to the parent NamespacePath.java.util.List<java.lang.String>getParts()Returns the individual parts of the path as elements in a list.SymbolTypegetType()Returns theSymbolTypeof this namespace element (ie.inthashCode()booleanisRoot()Returns true if this namespace path points to the root of the namespace space.java.lang.StringtoString()
 
- 
- 
- 
Field Detail- 
ROOTpublic static final NamespacePath ROOT 
 
- 
 - 
Method Detail- 
createpublic static NamespacePath create(NamespacePath parent, java.lang.String name, SymbolType type) Creates a newNamespacePathinstance.- Parameters:
- parent- optional - parent- NamespacePathinstance, default to- ROOTif null.
- name- string name of the new namespace.
- type-- SymbolTypeof the named space - ie. a "namespace", a class,
- Returns:
- new NamespacePath
 
 - 
isRootpublic boolean isRoot() Returns true if this namespace path points to the root of the namespace space.- Returns:
- boolean true if ROOT
 
 - 
getNamepublic java.lang.String getName() Returns the name of this namespace element, ie. the last thing on the path.- Returns:
- string name.
 
 - 
getParentpublic NamespacePath getParent() Returns a reference to the parent NamespacePath.- Returns:
- parent NamespacePath
 
 - 
getTypepublic SymbolType getType() Returns theSymbolTypeof this namespace element (ie. the symbol type of the last thing on the path).- Returns:
- SymbolType
 
 - 
asNamespaceStringpublic java.lang.String asNamespaceString() Converts this namespace path into aNamespacestyle string.- Returns:
- string path "ROOT::namespace1::namespace2"
 
 - 
asFormattedStringpublic java.lang.String asFormattedString() Converts this namespace path into aNamespacestyle string without the ROOT namespace included.- Returns:
- string path "namespace1::namespace2"
 
 - 
getPartspublic java.util.List<java.lang.String> getParts() Returns the individual parts of the path as elements in a list.- Returns:
- list of strings containing individual parts of the path
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
compareTopublic int compareTo(NamespacePath otherPath) - Specified by:
- compareToin interface- java.lang.Comparable<NamespacePath>
 
 
- 
 
-