XRootD
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

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

46#define XOSINTFORM(f,b) \
47 int buf_len = 256; \
48 va_list ap; \
49 va_start(ap, f); \
50again: \
51 b = (char *)realloc(b, buf_len); \
52 int n = vsnprintf(b, buf_len, f, ap); \
53 if (n == -1 || n >= buf_len) { \
54 if (n == -1) \
55 buf_len *= 2; \
56 else \
57 buf_len = n+1; \
58 va_end(ap); \
59 va_start(ap, f); \
60 goto again; \
61 } \
62 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.

1177{
1178 // Binary operator+
1179 XrdOucString res(s1,s2.length()+strlen(s1));
1180 res.insert(s2);
1181 return res;
1182}
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 1185 of file XrdOucString.cc.

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

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.

1195{
1196 // Binary operator+
1198 res.insert(i);
1199 res.insert(s);
1200 return res;
1201}
#define kMAXINT64LEN

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.

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

◆ operator+() [5/7]

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

Definition at line 1058 of file XrdOucString.cc.

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

◆ operator+() [6/7]

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

Definition at line 1069 of file XrdOucString.cc.

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

◆ operator+() [7/7]

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

Definition at line 1047 of file XrdOucString.cc.

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

◆ operator<<()

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

Definition at line 1164 of file XrdOucString.cc.

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

References XrdOucString::c_str().

+ Here is the call graph for this function: