XRootD
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.

◆ XOSINTFORM

#define XOSINTFORM (   f,
 
)
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.

Function Documentation

◆ operator+() [1/7]

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

Definition at line 1178 of file XrdOucString.cc.

1179 {
1180  // Binary operator+
1181  XrdOucString res(s1,s2.length()+strlen(s1));
1182  res.insert(s2);
1183  return res;
1184 }
int length() const

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 1187 of file XrdOucString.cc.

1188 {
1189  // Binary operator+
1190  XrdOucString res(c,s.length()+1);
1191  res.insert(s);
1192  return res;
1193 }

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 1196 of file XrdOucString.cc.

1197 {
1198  // Binary operator+
1199  XrdOucString res(s.length()+kMAXINT64LEN);
1200  res.insert(i);
1201  res.insert(s);
1202  return res;
1203 }
#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 1038 of file XrdOucString.cc.

1039 {
1040  // Return string resulting from concatenation
1041 
1042  XrdOucString ns(s1);
1043  if (s && strlen(s))
1044  ns.append(s);
1045  return ns;
1046 }

◆ operator+() [5/7]

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

Definition at line 1060 of file XrdOucString.cc.

1061 {
1062  // Return string resulting from concatenation of local string
1063  // and char c
1064 
1065  XrdOucString ns(s1);
1066  ns.append(c);
1067  return ns;
1068 }

◆ operator+() [6/7]

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

Definition at line 1071 of file XrdOucString.cc.

1072 {
1073  // Return string resulting from concatenation of local string
1074  // and string representing integer i.
1075 
1076  XrdOucString ns(s1);
1077  ns.append(i);
1078  return ns;
1079 }

◆ operator+() [7/7]

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

Definition at line 1049 of file XrdOucString.cc.

1050 {
1051  // Return string resulting from concatenation
1052 
1053  XrdOucString ns(s1);
1054  if (s.length())
1055  ns.append(s);
1056  return ns;
1057 }

◆ operator<<()

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

Definition at line 1166 of file XrdOucString.cc.

1167 {
1168  // Operator << is useful to print a string into a stream
1169 
1170  if (s.c_str())
1171  os << s.c_str();
1172  else
1173  os << "";
1174  return os;
1175 }
const char * c_str() const

References XrdOucString::c_str().

+ Here is the call graph for this function: