![]() |
XRootD
|
#include <XrdOucECMsg.hh>
Public Member Functions | |
XrdOucECMsg (const char *msgid=0) | |
~XrdOucECMsg () | |
XrdOucECMsg & | Append (char dlm='\n') |
int | Get (std::string &ecm, bool rst=true) |
bool | hasMsg () const |
std::string & | Msg () |
void | Msg (const char *pfx, const char *txt1, const char *txt2=0, const char *txt3=0, const char *txt4=0, const char *txt5=0) |
void | Msgf (const char *pfx, const char *fmt,...) |
void | MsgVA (const char *pfx, const char *fmt, std::va_list aP) |
void | MsgVec (const char *pfx, char const *const *vecP, int vecN) |
XrdOucECMsg & | operator= (const char *rhs) |
XrdOucECMsg & | operator= (const int rhs) |
Assignment operators for convenience. More... | |
XrdOucECMsg & | operator= (const std::string &rhs) |
XrdOucECMsg & | operator= (XrdOucECMsg &rhs) |
void | Set (int ecc, const char *ecm="") |
void | Set (int ecc, std::string &ecm) |
int | SetErrno (int ecc, int retval=-1, const char *alt=0) |
Definition at line 36 of file XrdOucECMsg.hh.
|
inline |
Definition at line 167 of file XrdOucECMsg.hh.
|
inline |
Definition at line 168 of file XrdOucECMsg.hh.
|
inline |
Append subsequent message to contents of ecMsg using delimeter. Append allows method chaining for a more natural progamming style.
dlm | !0 -> The character to use as message separator. dlm =0 -> Turns off appending, next message replaces ecMsg. |
Definition at line 50 of file XrdOucECMsg.hh.
int XrdOucECMsg::Get | ( | std::string & | ecm, |
bool | rst = true |
||
) |
Get err code and error message.
ecm | Reference to std:string where message is to be placed. |
rst | When true, the eCode and internal string are set to null. |
Definition at line 41 of file XrdOucECMsg.cc.
References ec.
Referenced by XrdPosixXrootd::QueryError().
|
inline |
Determine if an error text message exists.
Definition at line 69 of file XrdOucECMsg.hh.
|
inline |
Return the message string.
Definition at line 77 of file XrdOucECMsg.hh.
void XrdOucECMsg::Msg | ( | const char * | pfx, |
const char * | txt1, | ||
const char * | txt2 = 0 , |
||
const char * | txt3 = 0 , |
||
const char * | txt4 = 0 , |
||
const char * | txt5 = 0 |
||
) |
Insert a space delimited error message into ecMsg string.
pfx | !0 -> the text to prefix the message; the message is formed as pfx: txt1 [txt2] [txt3] pfx =0 -> insert message into ecMsg without a prefix. |
txt1,txt2,txt3,txt4,txt5 | the message to be inserted to ecMsg. |
Definition at line 59 of file XrdOucECMsg.cc.
References MsgVec().
void XrdOucECMsg::Msgf | ( | const char * | pfx, |
const char * | fmt, | ||
... | |||
) |
Insert a formated error message into ecMsg using variable args.
pfx | !0 -> the text to prefix the message; the message is formed as <pfx>: <formated_text> pfx =0 -> insert message without a prefix. |
fmt | the message formatting template (i.e. sprintf format). |
... | the arguments that should be used with the template. The formatted message is truncated at 2048 bytes. |
Definition at line 91 of file XrdOucECMsg.cc.
Referenced by XrdPosixAdmin::isOK(), and SetErrno().
void XrdOucECMsg::MsgVA | ( | const char * | pfx, |
const char * | fmt, | ||
std::va_list | aP | ||
) |
Insert a formated error message into the ecMsg using a va_list.
pfx | !0 -> the text to prefix the message; the message is formed as <pfx>: <formated_text> pfx =0 -> add message to the log without a prefix. |
fmt | the message formatting template (i.e. sprintf format). |
aP | the arguments that should be used with the template. The formatted message is truncated at 2048 bytes. |
Definition at line 112 of file XrdOucECMsg.cc.
void XrdOucECMsg::MsgVec | ( | const char * | pfx, |
char const *const * | vecP, | ||
int | vecN | ||
) |
Insert a formated error message into ecMsg using an iovec.
pfx | !0 -> the text to prefix the message; the message is formed as pfx: <iovec> pfx =0 -> insert message into ecMsg without a prefix. |
vecP | pointer to a vector strings to insert into the message. Spaces are not inserted between the elements. |
vecN | the number of elements in vecP. |
Definition at line 131 of file XrdOucECMsg.cc.
Referenced by Msg().
|
inline |
Definition at line 162 of file XrdOucECMsg.hh.
|
inline |
Assignment operators for convenience.
Definition at line 158 of file XrdOucECMsg.hh.
|
inline |
Definition at line 160 of file XrdOucECMsg.hh.
|
inline |
Definition at line 164 of file XrdOucECMsg.hh.
|
inline |
Set error message and error code.
ecc | The error code. |
ecm | The error message, if nil then message is not changed. |
Definition at line 138 of file XrdOucECMsg.hh.
Referenced by XrdPosixAdmin::isOK().
|
inline |
Definition at line 140 of file XrdOucECMsg.hh.
int XrdOucECMsg::SetErrno | ( | int | ecc, |
int | retval = -1 , |
||
const char * | alt = 0 |
||
) |
Set default error message, error code, and errno.
ecc | The error code. |
ret | The value to be returned, default -1. |
alt | Alternative message, default text of ecc error. |
Definition at line 144 of file XrdOucECMsg.cc.
References Msgf(), and XrdSysE2T().
Referenced by XrdPosixXrootd::Access(), XrdPosixXrootd::Close(), XrdPosixXrootd::Closedir(), XrdPosixDir::Open(), XrdPosixXrootd::Opendir(), XrdPosixXrootd::Pread(), XrdPosixXrootd::Pwrite(), XrdPosixAdmin::Query(), XrdPosixXrootd::QueryError(), XrdPosixXrootd::Readdir64(), XrdPosixXrootd::Rename(), and XrdPosixXrootd::Telldir().