Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-03-14 09:49:56 +0000
committerMarkus Schorn2008-03-14 09:49:56 +0000
commit7bce911157b74fac683622df8df63d06edb9d87c (patch)
treeab403e5bcc91044839cea9bad61c9ea0446c74f5 /core/org.eclipse.cdt.core/model/org
parent553c5a49feadfcf13414812ca71148bfd16da2b3 (diff)
downloadorg.eclipse.cdt-7bce911157b74fac683622df8df63d06edb9d87c.tar.gz
org.eclipse.cdt-7bce911157b74fac683622df8df63d06edb9d87c.tar.xz
org.eclipse.cdt-7bce911157b74fac683622df8df63d06edb9d87c.zip
For macro labels, append file paths if requested.
Diffstat (limited to 'core/org.eclipse.cdt.core/model/org')
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
index 00b581342f6..b09d71b6af3 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/core/model/util/CElementBaseLabels.java
@@ -21,6 +21,7 @@ import org.eclipse.cdt.core.model.IEnumerator;
import org.eclipse.cdt.core.model.IField;
import org.eclipse.cdt.core.model.IFunctionDeclaration;
import org.eclipse.cdt.core.model.IInheritance;
+import org.eclipse.cdt.core.model.IMacro;
import org.eclipse.cdt.core.model.IMethodDeclaration;
import org.eclipse.cdt.core.model.ISourceRoot;
import org.eclipse.cdt.core.model.ITemplate;
@@ -236,6 +237,9 @@ public class CElementBaseLabels {
buf.append(CONCAT_STRING);
}
switch (type) {
+ case ICElement.C_MACRO:
+ getMacroLabel((IMacro) element, flags, buf);
+ break;
case ICElement.C_METHOD :
case ICElement.C_METHOD_DECLARATION:
case ICElement.C_TEMPLATE_METHOD:
@@ -305,6 +309,24 @@ public class CElementBaseLabels {
}
/**
+ * Appends the label for a macro definition to a StringBuffer.
+ * @param macro a macro definition
+ * @param flags {@link #MF_POST_FILE_QUALIFIED}, or 0.
+ * @param buf the buffer to append the label to.
+ * @since 5.0
+ */
+ public static void getMacroLabel(IMacro macro, int flags, StringBuffer buf) {
+ buf.append(macro.getElementName());
+ if( getFlag(flags, MF_POST_FILE_QUALIFIED)) {
+ IPath path= macro.getPath();
+ if (path != null) {
+ buf.append( CONCAT_STRING );
+ buf.append(path.toString());
+ }
+ }
+ }
+
+ /**
* Appends the label for a method declaration to a StringBuffer.
* @param method a method declaration
* @param flags any of the M_* flags, and MF_POST_FILE_QUALIFIED

Back to the top