Hi,
I currently rework the global variables part of codeblocks and i stumbled on a problem in MacrosManager:
The compiler plugin an many other places use this set of functions:
void ReplaceMacros(wxString& buffer, const ProjectBuildTarget* target = nullptr, bool subrequest = false);
wxString ReplaceMacros(const wxString& buffer, const ProjectBuildTarget* target = nullptr);
void ReplaceEnvVars(wxString& buffer) { ReplaceMacros(buffer); } /* misnomer, should be ReplaceVariables */;
There is no possibility to report any error from this function, or deeper function for example if the global variable is not defined ecc...
Are there any ideas, how we can add error reporting?
One idea from me is, that we add a pointer to a "logger" class.
If the pointer is present log some error messages, if it is nullptr do nothing
A other idea would be to throw an exception
Any other ideas?
Keep in mind, this should work in any place in codeblocks:
* scripting
* plugins (ex. Tools menu)
* build process
* pre, post build steps
* ecc...