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   |
navi
Messages: 107 Registered: February 2012 Location: Sydney, Australia
|
Experienced Member |
|
|
DONE.
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));
Regards
Navi
[Updated on: Wed, 20 February 2013 00:41] Report message to a moderator
|
|
|
 |
|
why no virtual destructor for RegExp?
By: navi on Sat, 19 January 2013 06:22
|
 |
|
Re: why no virtual destructor for RegExp?
By: mirek on Sat, 19 January 2013 12:03
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Sat, 19 January 2013 12:30
|
 |
|
Re: why no virtual destructor for RegExp?
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Sat, 19 January 2013 13:26
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Fri, 25 January 2013 14:58
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Fri, 25 January 2013 15:01
|
 |
|
Re: why no virtual destructor for RegExp?
|
 |
|
Re: why no virtual destructor for RegExp?
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Fri, 25 January 2013 17:37
|
 |
|
Re: why no virtual destructor for RegExp?
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Mon, 28 January 2013 07:11
|
 |
|
Re: why no virtual destructor for RegExp?
By: mirek on Tue, 19 February 2013 17:15
|
 |
|
Re: why no virtual destructor for RegExp?
By: navi on Wed, 20 February 2013 00:23
|
Goto Forum:
Current Time: Mon Jun 09 14:28:57 CEST 2025
Total time taken to generate the page: 0.04279 seconds
|