maybe it is to late for me, but can someone lighten me what the second parameter in ReplaceMacros in the wizardscripts is?
ex. wxWidgets project script the boolean false:
buffer.Replace(_T("[NOW]"), ReplaceMacros(_T("$(TODAY)"), false));
in the wiki is only one parameter
http://wiki.codeblocks.org/index.php?title=Scripting_commands
wxString ReplaceMacros wxString Does variable expansion on the input wxString
and also the binding is made only with one parameter
wxString gReplaceMacros(const wxString& buffer){ return Manager::Get()->GetMacrosManager()->ReplaceMacros(buffer); }
SqPlus::RegisterGlobal(gReplaceMacros, "ReplaceMacros");
i have no idea where this second parameter is going...
greetings
I am guessing its a mistake.
I found the below in macrosmanager.h
void ReplaceMacros(wxString& buffer, ProjectBuildTarget* target = nullptr, bool subrequest = false);
wxString ReplaceMacros(const wxString& buffer, ProjectBuildTarget* target = nullptr);
I am guessing its using the second of those above.
Just a guess.
After looking closer; I think it is the first one of the two above.
Tim S.
After some more investigation i think this is a script error and sqplus don't give a error if the parameter count is to high. So what should i do? Correct the scripts, or provide a overloaded function with the given feature? (I think i will do the second, it is less work, but can have some side effects :P )
greetings
[Edit:]
After a second overlook i think the bool parameter is only for internal use:
void MacrosManager::ReplaceMacros(wxString& buffer, ProjectBuildTarget* target, bool subrequest)
{
[...]
while ((index = buffer.Index(toNativePath)) != wxNOT_FOUND)
{
int end = MatchBrace(buffer, index + toNativePath.Length() - 1);
wxString content = buffer.Mid(index + toNativePath.Length(), end - index - toNativePath.Length());
!!! ReplaceMacros(content, target, true);
buffer.Replace(buffer.Mid(index, end - index + 1), UnixFilename(content), false);
}
[...]
if (!subrequest)
{
buffer.Replace(_T("%%"), _T("%"));
buffer.Replace(_T("$$"), _T("$"));
}
}
so this functionality should not be ported to the scripts or should it?