SlickEdit Community
SlickEdit Product Discussion => SlickEditĀ® => Slick-CĀ® Macro Programming => Topic started by: gary_ash on August 04, 2006, 03:35:55 PM
-
Hi,
I'm trying to right a C++ utility macro and I'm having a hard time with the tagging support functions
I'm trying to find function prototypes, using the tagging system, given function names, class names etc can anybody give an example?
Thanks
Gary
-
This is a sketch, read the docs for the details on how to use each function. There are many other "tag_" functions you could use (see the reference documentation), depending on exactly what you are trying to do, the scope of your search, etc. tag_match_symbol_in_context() is the most general purpose and powerful. Pay careful attention to how you put together "class_name", it needs to be normalized if it is nested, see tag_insert_tag().
Another complete command you should look at is "implement_protos". Usually when someone is trying to find function prototypes, they are thinking they want to generate function stubs. "implement_protos" does that (only a little clumsy, that why it is not advertised).
int status = tag_match_symbol_in_context(
function_name, search_class,
0, 0, tags_filenamea(p_extension),
num_matches, max_matches,
VS_TAGFILTER_PROTO, VS_TAGCONTEXT_ANYTHING,
true, true, true, false, true
);
int i, n = tag_get_num_of_matches();
for ( i = 1; i <= n; ++i ) {
VS_TAG_BROWSE_INFO cm;
tag_get_match_info(i, cm);
// cm now has everything you need to know about this prototype
}
-
Thanks this is the missing bit for a few ideas I've had.