30 va_start( ap, format );
33 if (l<minlen) {
resize(minlen); l=minlen; }
34 int n=vsnprintf(
rawData(), l, format, ap);
43 if (index<0 || index>=(
int)
length())
return -1;
44 register const char *
pos;
47 pos = strchr(
data()+index,c);
52 c = tolower((
unsigned char)c);
53 while (*pos && tolower((
unsigned char)*pos)!=c) pos++;
54 if (!*pos && c) pos=0;
56 return pos ? (
int)(pos -
data()) : -1;
62 if (index<0 || index>=l)
return -1;
64 if (!*str)
return index;
65 register const char *
pos;
68 pos = strstr(
data()+index,str);
81 return pos ? (
int)(pos -
data()) : -1;
92 return d.
find( rx, index );
97 const char *
b =
data();
100 if (len==0)
return -1;
106 return pos ? (
int)(pos - b) : -1;
117 while ( pos>=b && *pos!=c) pos--;
121 c = tolower((
unsigned char)c);
122 while ( pos>=b && tolower((
unsigned char)*pos)!=c) pos--;
124 return pos>=b ? (
int)(pos - b) : -1;
131 if (index<0) index = len-slen;
132 else if (index>len)
return -1;
133 else if (index+slen>len) index=len-slen;
134 if (index<0)
return -1;
138 for (
int i=index; i>=0; i--)
if (
qstrncmp(pos--,str,slen)==0)
return i;
142 for (
int i=index; i>=0; i--)
if (
qstrnicmp(pos,str,slen)==0)
return i;
155 if (
length()==0)
return 0;
160 while (*pos)
if (*pos++ == c) count++;
164 c = tolower((
unsigned char)c);
167 if (tolower((
unsigned char)*pos)==c) count++;
176 if (str==0 ||
length()==0)
return 0;
184 if (
qstrncmp(pos,str,len)==0) count++;
240 if ((
int)len>l) len=
l;
241 const char *
pos =
data() + (l-len);
249 if (len==0xffffffff) len = slen-
index;
250 if (
isEmpty() || index>=slen || len==0)
272 *pos = tolower((
unsigned char)*pos);
288 *pos = toupper((
unsigned char)*pos);
300 register const char *
cs =
data();
302 if ( !isspace((
uchar)cs[0]) && !isspace((
uchar)cs[reslen-1]) )
306 register char *
s = result.
rawData();
308 int end = reslen - 1;
309 while ( isspace((
uchar) s[start]) )
311 if ( s[start] ==
'\0' )
315 while ( end && isspace((
uchar) s[end]) )
329 const char *from =
data();
334 while ( *from && isspace((
uchar) *from) )
336 while ( *from && !isspace((
uchar)*from) )
343 if ( to > first && *(to-1) == 0x20 )
346 result.
resize( (
int)((
long)to - (
long)result.
data()) + 1 );
358 if ( len == 0 )
return *
this;
360 int nlen = olen + len;
361 if ((
int)index>=olen)
363 resize(nlen+index-olen+1);
364 memset(
rawData()+olen,
' ', index-olen);
365 memcpy(
rawData()+index,s, len+1);
381 return insert( index, buf );
394 if ( index + len >= olen )
413 remove(
index, len );
492 register char *
p = &buf[19];
506 *--p = ((
int)(n%10)) +
'0';
509 if ( neg ) *--p =
'-';
517 register char *
p = &buf[19];
521 *--p = ((
int)(n%10)) +
'0';
535 d = (
char *)dst + len - 1;
536 s = (
char *)src + len - 1;
539 }
else if ( dst < src ) {
552 char *dst =
new char[
qstrlen(str)+1];
554 return strcpy( dst, str );
561 strncpy( dst, src, len );
569 register const uchar *s1 = (
const uchar *)str1;
570 register const uchar *s2 = (
const uchar *)str2;
574 return s1 == s2 ? 0 : (
int)((
long)s2 - (long)s1);
575 for ( ; !(res = (c=tolower(*s1)) - tolower(*s2)); s1++, s2++ )
583 register const uchar *s1 = (
const uchar *)str1;
584 register const uchar *s2 = (
const uchar *)str2;
588 return (
int)((long)s2 - (
long)s1);
589 for ( ; len--; s1++, s2++ ) {
590 if ( (res = (c=tolower(*s1)) - tolower(*s2)) )
598 #ifndef QT_NO_DATASTREAM 609 if ( len == 0 || s.
eof() ) {
614 #if defined(CHECK_NULL) 615 qWarning(
"QDataStream: Not enough memory to read QByteArray" );
633 if ( len == 0 || s.
eof() ) {
638 #if defined(CHECK_NULL) 639 qWarning(
"QDataStream: Not enough memory to read QCString" );
648 #endif //QT_NO_DATASTREAM end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
Q_EXPORT int qstrncmp(const char *str1, const char *str2, uint len)
uint toUInt(bool *ok=0, int base=10) const
QCString stripWhiteSpace() const
QCString & operator+=(const char *str)
char * qstrncpy(char *dst, const char *src, uint len)
long toLong(bool *ok=0, int base=10) const
The QRegExp class provides pattern matching using regular expressions or wildcards.
int contains(char c, bool cs=TRUE) const
ushort toUShort(bool *ok=0, int base=10) const
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
QCString left(uint len) const
bool stripPrefix(const char *prefix)
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
void qWarning(const char *msg,...)
int find(char c, int index=0, bool cs=TRUE) const
static QString fromLatin1(const char *, int len=-1)
QCString operator+(const QCString &s1, const QGString &s2)
int findRev(char c, int index=-1, bool cs=TRUE) const
QCString & operator=(const QCString &s)
Q_EXPORT uint qstrlen(const char *str)
int qstricmp(const char *str1, const char *str2)
const char * ascii() const
QDataStream & writeBytes(const char *, uint len)
int contains(QChar c, bool cs=TRUE) const
QCString right(uint len) const
int toInt(bool *ok=0) const
QDataStream & readRawBytes(char *, uint len)
uint64 toUInt64(bool *ok=0) const
QCString & prepend(const char *s)
QString & replace(uint index, uint len, const QString &)
const char * data() const
QCString & insert(uint index, const char *s)
int findRev(QChar c, int index=-1, bool cs=TRUE) const
QCString mid(uint index, uint len=0xffffffff) const
QCString & assign(const char *str)
QCString & sprintf(const char *format,...)
QCString & setNum(short n)
long toLong(bool *ok=0) const
int find(QChar c, int index=0, bool cs=TRUE) const
ulong toULong(bool *ok=0) const
QDataStream & operator>>(QDataStream &s, QByteArray &a)
uint toUInt(bool *ok=0) const
short toShort(bool *ok=0) const
int toInt(bool *ok=0, int base=10) const
char * qstrdup(const char *str)
void * qmemmove(void *dst, const void *src, uint len)
The QDataStream class provides serialization of binary data to a QIODevice.
int qstrnicmp(const char *str1, const char *str2, uint len)
unsigned long long uint64
ushort toUShort(bool *ok=0) const
QCString & remove(uint index, uint len)
QCString & replace(uint index, uint len, const char *s)
ulong toULong(bool *ok=0, int base=10) const
QCString simplifyWhiteSpace() const
short toShort(bool *ok=0, int base=10) const
uint64 toUInt64(bool *ok=0, int base=10) const
QCString & append(const char *s)
QDataStream & operator<<(QDataStream &s, const QByteArray &a)