From: Robert M. <mc...@cf...> - 2003-04-16 13:52:05
|
Below is a draft of the announcement that I'm planning to comp.lang.c++.moderated Comments? -------------------------------------------------------------------------------- http:://tracestring.sourceforge.net traceString is a tool to read in C/C++ source and write new code with the name of routine placed at the start of the routine. This provides a portable way to answer the question: WHO AM I? The functionality of traceString can best be seen using a small example in C++. Given the following raw code: int Foo::bar(int a) { // rest of routine } It can be transformed by traceString to be: int Foo::bar(int a) { /* %TRACE% */ FUNC_TRACE("Foo::Bar(int a)"); /* %TRACE% */ // rest of routine } where the ``FUNC_TRACE("Foo::Bar(int a)");'' is under user control via a pattern file. Features: - A pattern file controls what traceString generates. - "Fully Qualified" name, name, and class name are available. - Knows about namespaces. - Fast: It is written in C++ and flex. On a Pentium 4 it converted 23000 lines of code in 61 files in 0.1 seconds. - More portable than compiler solutions. Other choices: - C99 standard calls for __func to produce the name. This is not available every where. - Gnu and Intel compiler have __FUNCTION__ and __PRETTY_FUNCTION__ but not available on all compilers - RTTI typeid().name() provides the name but it is not human readable under Gnu and Intel compilers. TraceString can work with a particular compiler solution via the pattern file. |