Example #1
0
 private IBinding getBinding(char[] name) {
   for (ICPPMethod m : getMethods()) {
     if (!(m instanceof ICPPConstructor) && CharArrayUtils.equals(name, m.getNameCharArray())) {
       return m;
     }
   }
   return null;
 }
Example #2
0
 private IBinding[] getPrefixBindings(char[] name) {
   List<IBinding> result = new ArrayList<IBinding>();
   IContentAssistMatcher matcher = ContentAssistMatcherFactory.getInstance().createMatcher(name);
   for (ICPPMethod m : getMethods()) {
     if (!(m instanceof ICPPConstructor)) {
       if (matcher.match(m.getNameCharArray())) {
         result.add(m);
       }
     }
   }
   return result.toArray(new IBinding[result.size()]);
 }
 @Override
 public boolean isExplicit() {
   IBinding spec = getSpecializedBinding();
   if (spec instanceof ICPPMethod) {
     ((ICPPMethod) spec).isExplicit();
   }
   return false;
 }
 @Override
 public int getVisibility() {
   IBinding spec = getSpecializedBinding();
   if (spec instanceof ICPPMethod) {
     ((ICPPMethod) spec).getVisibility();
   }
   return 0;
 }
 private IName[] findDeclNames(IASTTranslationUnit ast, NameKind kind, IBinding binding)
     throws CoreException {
   IName[] declNames = findNames(fIndex, ast, kind, binding);
   // Bug 207320, handle template instances.
   while (declNames.length == 0 && binding instanceof ICPPSpecialization) {
     binding = ((ICPPSpecialization) binding).getSpecializedBinding();
     if (binding != null && !(binding instanceof IProblemBinding)) {
       declNames = findNames(fIndex, ast, NameKind.DEFINITION, binding);
     }
   }
   if (declNames.length == 0 && binding instanceof ICPPMethod) {
     // Bug 86829, handle implicit methods.
     ICPPMethod method = (ICPPMethod) binding;
     if (method.isImplicit()) {
       IBinding clsBinding = method.getClassOwner();
       if (clsBinding != null && !(clsBinding instanceof IProblemBinding)) {
         declNames = findNames(fIndex, ast, NameKind.REFERENCE, clsBinding);
       }
     }
   }
   return declNames;
 }