1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 17:56:01 +02:00

Minor API improvement.

Change-Id: Ie0b6ab44139c080dc5200c0a9c01cca0bbb9ca04
This commit is contained in:
Sergey Prigogin 2015-07-10 16:28:27 -07:00
parent 5d37fc84c6
commit e091732356
2 changed files with 16 additions and 8 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others. * Copyright (c) 2004, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -18,15 +18,19 @@ import org.eclipse.cdt.core.dom.ast.IBinding;
* @noimplement This interface is not intended to be implemented by clients. * @noimplement This interface is not intended to be implemented by clients.
*/ */
public interface ICPPASTTranslationUnit extends IASTTranslationUnit { public interface ICPPASTTranslationUnit extends IASTTranslationUnit {
/**
* Returns the global namespace of the translation unit.
*
* @since 5.11
*/
public ICPPNamespace getGlobalNamespace();
/** /**
* Resolve the binding for translation unit. * @deprecated Use {@link #getGlobalNamespace()}
*
* @return <code>IBinding</code>
*/ */
@Deprecated
public IBinding resolveBinding(); public IBinding resolveBinding();
/** /**
* @since 5.1 * @since 5.1
*/ */

View file

@ -139,14 +139,18 @@ public class CPPASTTranslationUnit extends ASTTranslationUnit implements ICPPAST
} }
@Override @Override
public IBinding resolveBinding() { public ICPPNamespace getGlobalNamespace() {
if (fBinding == null) if (fBinding == null)
fBinding = new CPPNamespace(this); fBinding = new CPPNamespace(this);
return fBinding; return fBinding;
} }
@Override @Override @Deprecated
@Deprecated public IBinding resolveBinding() {
return getGlobalNamespace();
}
@Override @Deprecated
public ParserLanguage getParserLanguage() { public ParserLanguage getParserLanguage() {
return ParserLanguage.CPP; return ParserLanguage.CPP;
} }