Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] IStructure from name

Hi!

I'm trying to parse a C++ method body in order to get some information.
The following code snippet shows my situation:

class AllTests {
public:
	static CPPUNIT_NS::Test * suite() {
		std::auto_ptr<CPPUNIT_NS::TestSuite> suite(new
CPPUNIT_NS::TestSuite("AllTests") );

		// $ECUT-begin-tests$
			suite->addTest( SimpleTest::suite() );
		// $ECUT-end-tests$

		return suite.release();
	}
};

I have the IStructure of "AllTests" and I want to get all IStructure
objects that are added within the "suite()" body.

I tried the following:
IStructure testSuiteClass = ...
String testSuiteSource = testSuiteClass.getSource();
String name = parseNextStructureName(testSuiteSource);

My question is where can I get the IStructure object when I have the
"String" name? Or must I use AST parsing here?

Thanx in advance.
Gerhard






Back to the top