summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
a087113)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56223
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
// utility to parse gccXML ID values;
// this function is equivalent to wxString(str).Mid(1).ToULong(&id, GCCXML_BASE)
// but is a little bit faster
// utility to parse gccXML ID values;
// this function is equivalent to wxString(str).Mid(1).ToULong(&id, GCCXML_BASE)
// but is a little bit faster
-bool getID(unsigned long *id, const wxStringCharType* str)
+bool getID(unsigned long *id, const wxString& str)
+ const wxStringCharType * const start = str.wx_str();
wxStringCharType *end;
#if wxUSE_UNICODE_WCHAR
wxStringCharType *end;
#if wxUSE_UNICODE_WCHAR
- unsigned long val = wcstoul(str+1, &end, GCCXML_BASE);
+ unsigned long val = wcstoul(start, &end, GCCXML_BASE);
- unsigned long val = strtoul(str+1, &end, GCCXML_BASE);
+ unsigned long val = strtoul(start, &end, GCCXML_BASE);
#endif
// return true only if scan was stopped by the terminating NUL and
// if the string was not empty to start with and no under/overflow
// occurred:
#endif
// return true only if scan was stopped by the terminating NUL and
// if the string was not empty to start with and no under/overflow
// occurred:
- if ( *end != '\0' || end == str+1 || errno == ERANGE || errno == EINVAL )
+ if ( *end != '\0' || end == start || errno == ERANGE || errno == EINVAL )
// utility specialized to parse efficiently the gccXML list of IDs which occur
// in nodes like <Class> ones... i.e. numeric values separed by " _" token
// utility specialized to parse efficiently the gccXML list of IDs which occur
// in nodes like <Class> ones... i.e. numeric values separed by " _" token
-bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxStringCharType* str)
+bool getMemberIDs(wxClassMemberIdHashMap* map, wxClass* p, const wxString& str)
+ const wxStringCharType * const start = str.wx_str();
- size_t len = wcslen(str);
+ size_t len = wcslen(start);
- size_t len = strlen(str);
+ size_t len = strlen(start);
- if (len == 0 || str[0] != '_')
+ if (len == 0 || start[0] != '_')
- const wxStringCharType *curpos = str,
- *end = str + len;
+ const wxStringCharType *curpos = start,
+ *end = start + len;
wxStringCharType *nexttoken;
while (curpos < end)
wxStringCharType *nexttoken;
while (curpos < end)