23 const char rlCRLF[3] = {0x0d, 0x0a, 0};
27 txt =
new char [strlen(
text)+1];
34 txt =
new char [strlen(s2.
text())+1];
41 txt =
new char [strlen(s2->
text())+1];
48 txt =
new char [strlen(s2.
text())+1];
57 if(
tmp != NULL)
delete []
tmp;
98 if(strcmp(
txt,s2) == 0)
return 1;
104 if(strcmp(
txt,s2.
text()) == 0)
return 1;
110 if(strcmp(
txt,s2.
text()) == 0)
return 1;
116 if(strcmp(
txt,s2) != 0)
return 1;
122 if(strcmp(
txt,s2.
text()) != 0)
return 1;
138 int ret = strlen(
text);
140 txt =
new char [ret+1];
154 if(ret < 0)
return ret;
156 txt =
new char [strlen(mystring)+1];
164 int len = strlen(
text);
165 txt =
new char [len+1];
174 int len = strlen(
txt) + strlen(
text);
175 txt =
new char [len+1];
184 if(substring == NULL)
return NULL;
185 return ::strstr(
txt,substring);
210 return ::strcmp(my.
text(),o.
text());
220 return ::strncmp(my.
text(),o.
text(),n);
225 return ::strchr(
txt,c);
230 return ::strrchr(
txt,c);
236 int state=0, inquotas=0, j=0;
237 int len = strlen(
txt);
239 for(
int i=0;i<len;i++)
273 if(
txt == NULL)
return -1;
275 if(cptr != NULL) *cptr =
'\0';
283 if(lstat(filename,&statbuf))
return -1;
285 if(stat(filename,&statbuf))
return -1;
287 FILE *fin = fopen(filename,
"r");
288 if(fin == NULL)
return -1;
289 if(
txt != NULL)
delete []
txt;
290 txt =
new char [statbuf.st_size+1];
291 fread(
txt, 1, statbuf.st_size, fin);
292 txt[statbuf.st_size] =
'\0';
294 return statbuf.st_size;
299 if(
txt == NULL)
return -1;
300 FILE *fout = fopen(filename,
"w");
301 if(fout == NULL)
return -1;
302 int len = strlen(
txt);
303 fprintf(fout,
"%s",
txt);
311 int len = ::strlen(
txt);
312 if(
tmp != NULL)
delete []
tmp;
313 tmp =
new char [len+1];
318 char *cptr = &
txt[0];
319 if(*cptr ==
'/') cptr++;
320 int len = ::strlen(cptr);
321 if(
tmp != NULL)
delete []
tmp;
322 tmp =
new char [len+1];
327 if(*cptr ==
'/') *cptr =
'\\';
333 char *cptr = &
txt[0];
334 if(*cptr ==
'/') cptr++;
335 int len = ::strlen(cptr);
336 if(
tmp != NULL)
delete []
tmp;
337 tmp =
new char [len+1];
340 if(cptr != NULL) *cptr =
'[';
342 if(cptr != NULL) *cptr =
']';
346 if(*cptr ==
'/') *cptr =
'.';
356 int len = ::strlen(
txt);
357 if(
tmp != NULL)
delete []
tmp;
358 tmp =
new char [len+1];
363 char *cptr = &
txt[0];
364 if(*cptr ==
'/') cptr++;
365 int len = ::strlen(cptr);
366 if(
tmp != NULL)
delete []
tmp;
367 tmp =
new char [len+1];
372 if(*cptr ==
'/') *cptr =
'\\';
378 char *cptr = &
txt[0];
379 if(*cptr ==
'/') cptr++;
380 int len = ::strlen(cptr);
381 if(
tmp != NULL)
delete []
tmp;
382 tmp =
new char [len+2];
385 if(cptr != NULL) *cptr =
'[';
389 if(*cptr ==
'/') *cptr =
'.';
int read(const char *filename)
const char * toFilename()
int removeQuotas(char c='"')
int startsWith(const char *startstr)
int operator!=(const char *s2)
int cat(const char *text)
char * strstr(const char *substring)
rlString & operator=(const char *s2)
int strcpy(const char *text)
int rlvsnprintf(char *text, int len, const char *format, va_list ap)
int setText(const char *text)
int strnnocasecmp(const char *other, int n)
int strnocasecmp(const char *other)
int printf(const char *format,...)
int operator==(const char *s2)
int rlStartsWith(const char *str, const char *startstr)
rlString & operator+(const char *s2)
int write(const char *filename)
rlString & operator+=(const char *s2)
rlString(const char *text="")