I have a large C++ code base that contains a couple of functions for error logging that I'm planning to rewrite, defined as follows;
void LogError(ErrorLevel elvl,LPCTSTR Format,...); // Literal version
void LogError(ErrorLevel elvl,UINT ResourceID,...); // Resource version
I'm planning to rewrite these as a single function
void LogError(ErrNo No,...);
ErrNo in this case is will be an enum, used to look up the rest of the error details from an external file. While I'm using and love Visual Assist, it doesn't appear to be up to this kind of thing. I'm thinking the easiest way to carry out this refactor is to write a small program that uses the results of a search output to find all the occurences of this function, e.g.
c:\cpp\common\Atlas\Comps\LSADJUST.cpp
LSAFormNormalEquations (174): LogError(elvl_Error,IDS_WINWRN0058,i+1,TravObs.setup_no,TravObs.round_no
LSAFormNormalEquations (180): LogError(elvl_Error,IDS_WINWRN0059,i+1,TravObs.setup_no,TravObs.round_no
LSAFormNormalEquations (186): LogError(elvl_Error,IDS_WINWRN0060,i+1,TravObs.setup_no,TravObs.round_no
c:\cpp\common\Atlas\Comps\LSADJUSTZ.CPP
LSAFormNormalEquationsZ (45): LogError(elvl_Note,_T("Adjusting heights by least squares"));
c:\cpp\Win32\Atlas\Section\OptmizeSectionVolumes.cpp
OnSectionOptimizeVolumes (239): LogError(elvl_Note,"Shifted section at chainage %0.1lf by %0.3lf",Graph.c1,Offset);
and then parse and modify the source. Are there any other tools that could simplify this task for me? If looked at a related question which suggets there isn't much out there. I don't mind spending a small amount for a reasonably easy to use tool, but don't have the time or budget for anything more than this.