Loading...
Searching...
No Matches
XrdOucString.cc File Reference
`#include <cstdio>`
`#include <cstring>`
`#include <climits>`
`#include "XrdOuc/XrdOucString.hh"`
Include dependency graph for XrdOucString.cc:

Go to the source code of this file.

## Macros

#define | kMAXINT64LEN 25
#define | XOSINTFORM(f, b)

## Functions

XrdOucString const | operator+ (const char *s1, const XrdOucString s2)
XrdOucString const | operator+ (const char c, const XrdOucString s)
XrdOucString const | operator+ (const int i, const XrdOucString s)
XrdOucString | operator+ (const XrdOucString &s1, const char *s)
XrdOucString | operator+ (const XrdOucString &s1, const char c)
XrdOucString | operator+ (const XrdOucString &s1, const int i)
XrdOucString | operator+ (const XrdOucString &s1, const XrdOucString &s)
std::ostream & | operator<< (std::ostream &os, const XrdOucString s)

## Macro Definition Documentation

## kMAXINT64LEN

#define kMAXINT64LEN 25

Definition at line 41 of file XrdOucString.cc.

Referenced by XrdOucString::insert(), operator+(), XrdOucString::operator=(), and XrdOucString::operator==().

## XOSINTFORM

#define XOSINTFORM | ( |  | f,
|  |  | b )

Value:
int buf_len = 256; \
va_list ap; \
va_start(ap, f); \
again: \
b = (char *)realloc(b, buf_len); \
int n = vsnprintf(b, buf_len, f, ap); \
if (n == -1 || n >= buf_len) { \
if (n == -1) \
buf_len *= 2; \
else \
buf_len = n+1; \
va_end(ap); \
va_start(ap, f); \
goto again; \
} \
va_end(ap);

Definition at line 46 of file XrdOucString.cc.

#define XOSINTFORM(f,b) \
int buf_len = 256; \
va_list ap; \
va_start(ap, f); \
again: \
b = (char *)realloc(b, buf_len); \
int n = vsnprintf(b, buf_len, f, ap); \
if (n == -1 || n >= buf_len) { \
if (n == -1) \
buf_len *= 2; \
else \
buf_len = n+1; \
va_end(ap); \
va_start(ap, f); \
goto again; \
} \
va_end(ap);

Referenced by XrdOucString::form(), and XrdOucString::form().

## Function Documentation

## operator+() [1/7]

XrdOucString const operator+ | ( | const char * | s1,
|  | const XrdOucString | s2 )

Definition at line 1176 of file XrdOucString.cc.

{
// Binary operator+
XrdOucString res(s1,s2.length()+strlen(s1));
res.insert(s2);
return res;
}
XrdOucString
Definition XrdOucString.hh:252
XrdOucString::length
int length() const
Definition XrdOucString.hh:279

References XrdOucString::insert(), and XrdOucString::length().

Here is the call graph for this function:

## operator+() [2/7]

XrdOucString const operator+ | ( | const char | c,
|  | const XrdOucString | s )

Definition at line 1185 of file XrdOucString.cc.

{
// Binary operator+
XrdOucString res(c,s.length()+1);
res.insert(s);
return res;
}

References XrdOucString::insert(), and XrdOucString::length().

Here is the call graph for this function:

## operator+() [3/7]

XrdOucString const operator+ | ( | const int | i,
|  | const XrdOucString | s )

Definition at line 1194 of file XrdOucString.cc.

{
// Binary operator+
XrdOucString res(s.length()+kMAXINT64LEN);
res.insert(i);
res.insert(s);
return res;
}
kMAXINT64LEN
#define kMAXINT64LEN
Definition XrdOucString.cc:41

References XrdOucString::insert(), kMAXINT64LEN, and XrdOucString::length().

Here is the call graph for this function:

## operator+() [4/7]

XrdOucString operator+ | ( | const XrdOucString & | s1,
|  | const char * | s )

Definition at line 1036 of file XrdOucString.cc.

{
// Return string resulting from concatenation
XrdOucString ns(s1);
if (s && strlen(s))
ns.append(s);
return ns;
}

## operator+() [5/7]

XrdOucString operator+ | ( | const XrdOucString & | s1,
|  | const char | c )

Definition at line 1058 of file XrdOucString.cc.

{
// Return string resulting from concatenation of local string
// and char c
XrdOucString ns(s1);
ns.append(c);
return ns;
}

## operator+() [6/7]

XrdOucString operator+ | ( | const XrdOucString & | s1,
|  | const int | i )

Definition at line 1069 of file XrdOucString.cc.

{
// Return string resulting from concatenation of local string
// and string representing integer i.
XrdOucString ns(s1);
ns.append(i);
return ns;
}

## operator+() [7/7]

XrdOucString operator+ | ( | const XrdOucString & | s1,
|  | const XrdOucString & | s )

Definition at line 1047 of file XrdOucString.cc.

{
// Return string resulting from concatenation
XrdOucString ns(s1);
if (s.length())
ns.append(s);
return ns;
}

## operator<<()

std::ostream & operator<< | ( | std::ostream & | os,
|  | const XrdOucString | s )

Definition at line 1164 of file XrdOucString.cc.

{
// Operator << is useful to print a string into a stream
if (s.c_str())
os << s.c_str();
else
os << "";
return os;
}
XrdOucString::c_str
const char * c_str() const
Definition XrdOucString.hh:278

References XrdOucString::c_str().

Here is the call graph for this function: