#include <XrdOucECMsg.hh>
Public Member Functions | |
| XrdOucECMsg (const char *msgid=0) | |
| ~XrdOucECMsg () | |
| XrdOucECMsg & | Append (char dlm='\n') |
| int | Get () |
| 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. | |
| 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 ret=-1, const char *alt=0) |
Definition at line 38 of file XrdOucECMsg.hh.
|
inline |
Definition at line 182 of file XrdOucECMsg.hh.
Referenced by Append(), operator=(), operator=(), operator=(), and operator=().
|
inline |
Definition at line 183 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 52 of file XrdOucECMsg.hh.
References XrdOucECMsg().
|
inline |
Definition at line 65 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(), and XrdPosixXrootd::QueryError().
|
inline |
Determine if an error text message exists.
Definition at line 73 of file XrdOucECMsg.hh.
|
inline |
Return the message string.
Definition at line 83 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 61 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 93 of file XrdOucECMsg.cc.
| 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 116 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 137 of file XrdOucECMsg.cc.
Referenced by Msg().
|
inline |
Definition at line 174 of file XrdOucECMsg.hh.
References XrdOucECMsg().
|
inline |
Assignment operators for convenience.
Definition at line 168 of file XrdOucECMsg.hh.
References XrdOucECMsg().
|
inline |
Definition at line 171 of file XrdOucECMsg.hh.
References XrdOucECMsg().
|
inline |
Definition at line 177 of file XrdOucECMsg.hh.
References XrdOucECMsg().
|
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 146 of file XrdOucECMsg.hh.
Referenced by XrdPosixMap::Entry2Buf().
|
inline |
Definition at line 149 of file XrdOucECMsg.hh.
| int XrdOucECMsg::SetErrno | ( | int | ecc, |
| int | ret = -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 152 of file XrdOucECMsg.cc.
References XrdSysE2T().
Referenced by XrdPosixExtra::pgRead(), XrdPosixExtra::pgWrite(), XrdPosixXrootd::Pread(), and XrdPosixXrootd::Pwrite().