Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] find binding with qualified name

Well. I'm confused. I should have read more carefully the different methods.
The javadoc is sufficient. It's just me. I may have been a bit exhausted yesterday.

Thanks anyway and sorry for the inconvenience.

--
Nicolas


Schorn, Markus wrote:
Maybe I need to improve the javadoc. I thought this is obvious:

You can use either one of:
findBindings(char[][] names, IndexFilter filter, IProgressMonitor
monitor) findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter
filter, IProgressMonitor monitor)
You need to split the qualified name into segements yourself.
Markus.

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nicolas Musset
Sent: Wednesday, July 08, 2009 5:33 PM
To: CDT General developers list.
Subject: Re: [cdt-dev] find binding with qualified name
Importance: Low

I know, but it does not work the way I thought. That's why I asked.
For me, the full qualified name of getField is myClass::getField. But I works only with simple name getField.
Another example is 'myClass'. findBindings returns

myClass CPPCLASSTYPE
myClass(const myClass &) CPP_CONSTRUCTOR
myClass() CPP_CONSTRUCTOR

What I'm looking for is a method that will take the full qualified name and returns only the corresponding bindings. That is to say:
- myClass will return myClass CPPCLASSTYPE
- myClass::myClass will return myClass(const myClass &) CPP_CONSTRUCTOR and myClass() CPP_CONSTRUCTOR

Of course I could write my own method starting from the root (here
myClass) and recursively get children and look into each of them until I find the good one. But I'm wondering whether this is already done in some internal classes of CDT. So if you had provided a public method that took this full qualified name, it would have been a great help.

Nevertheless, I will find another way to do it.

Thanks,
--
Nicolas


Schorn, Markus wrote:
Hint 1: IIndex contains more than one findBindings method.
Hint 2: All of these methods have java-doc.

Markus.

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx
[mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Nicolas Musset
Sent: Wednesday, July 08, 2009 3:21 PM
To: CDT General developers list.
Subject: [cdt-dev] find binding with qualified name
Importance: Low

How can I get the correct binding with a full qualified name?
Let's illustrate with an example:

class myClass {
public:
    myClass();
    virtual ~myClass();

    std::string getField() { return _field; }
    void setField(std::string str) { _field = str; }

private:
    std::string _field;
};

If I call IIndex.findBindings with "myClass" I only get the class declaration. But if I call it with myClass::~myClass, or simply ~myClass, I got nothing.

Is there a method that can take a full qualified name (e.g. myClass::~myClass) and returns the corresponding binding ?
I need it
to navigate from Ada to C++. From Ada, I get an ABI symbol (e.g.
_ZN7myClassD1Ev) and with c++filt I retrieve the full
qualified name
(e.g. myClass::~myClass() ). Then I ask the IIndex with
findBindings.
It works with C but not with C++.

Any idea?

--
Nicolas
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev



Back to the top