1 #ifndef __OUC_STRING_H__
2 #define __OUC_STRING_H__
267 int adjust(
int ls,
int &j,
int &k,
int nmx = 0);
268 char *bufalloc(
int nsz);
269 inline void init() { str = 0; len = 0; siz = 0; }
272 XrdOucString(
int lmx = 0) { init();
if (lmx > 0) str = bufalloc(lmx+1); }
280 const char *
c_str()
const {
return (
const char *)str; }
283 char &operator[](
int j);
284 int find(
const char c,
int start = 0,
bool forward = 1);
285 int find(
const char *s,
int start = 0);
288 {
return find(c, start, 0); }
289 int rfind(
const char *s,
int start =
STR_NPOS);
294 bool endswith(
char c);
295 bool endswith(
const char *s);
297 int matches(
const char *s,
char wch =
'*');
300 int tokenize(
XrdOucString &tok,
int from,
char del =
':');
303 void resize(
int lmx = 0) {
int ns = (lmx > 0) ? lmx + 1 : 0;
304 str = bufalloc(ns); }
305 void append(
const int i);
306 void append(
const char c);
307 void append(
const char *s);
309 void assign(
const char *s,
int j,
int k = -1);
311 #if !defined(WINDOWS)
312 int form(
const char *fmt, ...);
314 int keep(
int start = 0,
int size = 0);
315 void insert(
const int i,
int start = -1);
316 void insert(
const char c,
int start = -1);
317 void insert(
const char *s,
int start = -1,
int lmx = 0);
319 int replace(
const char *s1,
const char *s2,
320 int from = 0,
int to = -1);
322 int from = 0,
int to = -1);
324 int from = 0,
int to = -1);
326 int from = 0,
int to = -1);
327 int erase(
int start = 0,
int size = 0);
328 int erase(
const char *s,
int from = 0,
int to = -1);
332 void lower(
int pos,
int size = 0);
333 void upper(
int pos,
int size = 0);
334 void reset(
const char c,
int j = 0,
int k = -1);
336 void setbuffer(
char *buf);
355 int operator==(
const int i);
356 int operator==(
const char c);
357 int operator==(
const char *s);
367 bool isdigit(
int from = 0,
int to = -1);
368 long atoi(
int from = 0,
int to = -1);
371 static int getblksize();
372 static void setblksize(
const int bs);
374 #if !defined(WINDOWS)
376 static int form(
XrdOucString &str,
const char *fmt, ...);
int rfind(const char c, int start=STR_NPOS)
Definition: XrdOucString.hh:287
ostream & operator<<(ostream &, const XrdOucString s)
int len
Definition: XrdOucString.hh:258
const char * c_str() const
Definition: XrdOucString.hh:280
XrdOucString(int lmx=0)
Definition: XrdOucString.hh:272
void resize(int lmx=0)
Definition: XrdOucString.hh:303
bool beginswith(XrdOucString s)
Definition: XrdOucString.hh:293
static int blksize
Definition: XrdOucString.hh:264
int erasefromstart(int sz=0)
Definition: XrdOucString.hh:330
int operator!=(const char *s)
Definition: XrdOucString.hh:363
#define STR_NPOS
Definition: XrdOucString.hh:252
bool beginswith(char c)
Definition: XrdOucString.hh:291
int siz
Definition: XrdOucString.hh:259
int capacity() const
Definition: XrdOucString.hh:282
int erasefromend(int sz=0)
Definition: XrdOucString.hh:331
char * str
Definition: XrdOucString.hh:257
int operator!=(const XrdOucString s)
Definition: XrdOucString.hh:364
void init()
Definition: XrdOucString.hh:269
bool beginswith(const char *s)
Definition: XrdOucString.hh:292
int operator!=(const char c)
Definition: XrdOucString.hh:362
int length() const
Definition: XrdOucString.hh:281
bool endswith(XrdOucString s)
Definition: XrdOucString.hh:296
int operator!=(const int i)
Definition: XrdOucString.hh:361
XrdOucString const operator+(const char *s1, const XrdOucString s2)
Definition: XrdOucString.hh:254