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

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



Back to the top