mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Theide:minor fixes, Core: WString Filter(WString variants
git-svn-id: svn://ultimatepp.org/upp/trunk@1242 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
332216abd6
commit
2cbfc8721e
3 changed files with 25 additions and 1 deletions
|
|
@ -114,4 +114,25 @@ String FilterWhile(const char *s, int (*filter)(int))
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WString Filter(const wchar *s, int (*filter)(int))
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
while(*s) {
|
||||||
|
int c = (*filter)((byte)*s++);
|
||||||
|
if(c) result.Cat(c);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
WString FilterWhile(const wchar *s, int (*filter)(int))
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
while(*s) {
|
||||||
|
int c = (*filter)((byte)*s++);
|
||||||
|
if(!c) break;
|
||||||
|
result.Cat(c);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
END_UPP_NAMESPACE
|
END_UPP_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -787,4 +787,7 @@ int CharFilterNoCrLf(int c);
|
||||||
String Filter(const char *s, int (*filter)(int));
|
String Filter(const char *s, int (*filter)(int));
|
||||||
String FilterWhile(const char *s, int (*filter)(int));
|
String FilterWhile(const char *s, int (*filter)(int));
|
||||||
|
|
||||||
|
WString Filter(const wchar *s, int (*filter)(int));
|
||||||
|
WString FilterWhile(const wchar *s, int (*filter)(int));
|
||||||
|
|
||||||
#include "AString.hpp"
|
#include "AString.hpp"
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ LAYOUT(ListLayout, 660, 432)
|
||||||
ITEM(Splitter, splitter, HSizePosZ(4, 4).VSizePosZ(4, 60))
|
ITEM(Splitter, splitter, HSizePosZ(4, 4).VSizePosZ(4, 60))
|
||||||
ITEM(DataPusher, description, HSizePosZ(4, 6).BottomPosZ(36, 20))
|
ITEM(DataPusher, description, HSizePosZ(4, 6).BottomPosZ(36, 20))
|
||||||
ITEM(ProgressIndicator, progress, HSizePosZ(4, 4).BottomPosZ(39, 15))
|
ITEM(ProgressIndicator, progress, HSizePosZ(4, 4).BottomPosZ(39, 15))
|
||||||
ITEM(DropList, filter, LeftPosZ(4, 156).TopPosZ(404, 19))
|
ITEM(DropList, filter, LeftPosZ(4, 156).BottomPosZ(9, 19))
|
||||||
ITEM(EditString, search, LeftPosZ(164, 124).BottomPosZ(9, 19))
|
ITEM(EditString, search, LeftPosZ(164, 124).BottomPosZ(9, 19))
|
||||||
ITEM(Option, brief, SetLabel(t_("Brief list")).HSizePosZ(296, 240).BottomPosZ(8, 20))
|
ITEM(Option, brief, SetLabel(t_("Brief list")).HSizePosZ(296, 240).BottomPosZ(8, 20))
|
||||||
ITEM(Button, newu, SetLabel(t_("&New package")).RightPosZ(140, 90).BottomPosZ(8, 22))
|
ITEM(Button, newu, SetLabel(t_("&New package")).RightPosZ(140, 90).BottomPosZ(8, 22))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue