[cfe-dev] force c++ mode

Rolando Abarca funkaster at gmail.com
Mon Jun 11 15:24:16 PDT 2012


Hi,
I'm trying to play with the new python bindings, but so far I'm having
problems trying to force C++ mode, this is what I'm doing:

def parse_headers(headers, classes, args):
	print("will parse: " + str(headers) + " " + str(args))
	index = cindex.Index.create()
	tu = index.parse(headers, args)
	deep_iterate(tu.cursor, classes, 0, True)

args is something like this:

['-I../../cocos2dx/include', '-x', 'c++', '../../cocos2dx/include/CCNode.h']

basically, "-x c++" and the header file is the last arguments, as
suggested in a previous thread in this mailing list[1] but it still
not working... only changing the extension to ".hpp" actualy parses
the file as C++... What would be the way to force C++ mode without
actually renaming all my files to .hpp?

Thanks for any hint.

[1]: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-November/018684.html

-- 
Rolando
http://rolando.cl



More information about the cfe-dev mailing list