Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » why no virtual destructor for RegExp?
Re: why no virtual destructor for RegExp? [message #38928 is a reply to message #38795] Mon, 28 January 2013 07:11 Go to previous messageGo to previous message
navi is currently offline  navi
Messages: 107
Registered: February 2012
Location: Sydney, Australia
Experienced Member
DONE. Very Happy

Final Interface. Got rid of pattern and offset. 3 flavors of each. Also updated the demo, see updated screen cap above.

int  Replace(String& t, Vector<String>& rv, bool backref=false); //DONE
int  Replace(String& t, const String r, bool backref=false); //DONE
int  Replace(String& t, Callback1<Vector<String>&> cbr); //DONE
	
int  ReplaceGlobal(String& t, Vector<String>& rv, bool backref=false); //DONE
int  ReplaceGlobal(String& t, const String r, bool backref=false); //DONE
int  ReplaceGlobal(String& t, Callback1<Vector<String>&> cbr); //DONE


Callback works in same fashion as in U++ Menu and Bar. User writes a callback function with void return and "Vector<String>& v" argument. And uses the THISBACK macro to pass it to Replace() or ReplaceGlobal(). Inside the match_callback_fun() user gets a vector already populated with all the matches. any changes made to the vector will be reflected in the source string 't'.

void match_callback_fun(Vector<String>& v){
...
}

regx.Replace(t, THISBACK(match_callback_fun));
regx.ReplaceGlobal(t, THISBACK(match_callback_fun));


Rolling Eyes
Regards
Navi

[Updated on: Wed, 20 February 2013 00:41]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Details when compiling in 64 bits
Next Topic: Wanted: OpenGL for gtk+ backend
Goto Forum:
  


Current Time: Mon Jun 09 10:10:22 CEST 2025

Total time taken to generate the page: 0.04363 seconds