log4cplus  1.1.0
Classes | Typedefs | Enumerations | Functions | Variables
log4cplus::helpers Namespace Reference

Classes

class  AppenderAttachableImpl
 This Interface is for attaching Appenders to objects. More...
struct  FileInfo
 FileInfo structure is OS independent abstraction of the stat() function. More...
class  LockFile
class  LogLog
 This class used to output log statements from within the log4cplus package. More...
class  LogLogUser
 This class used to simplify the use of the LogLog class. More...
class  SharedObject
class  SharedObjectPtr
class  Properties
class  snprintf_buf
class  AbstractSocket
class  Socket
 This class implements client sockets (also called just "sockets"). More...
class  ServerSocket
 This class implements server sockets. More...
class  SocketBuffer
struct  ConvertIntegerToStringHelper< intType, true >
struct  ConvertIntegerToStringHelper< intType, false >
class  Time
 This class represents a Epoch time with microsecond accuracy. More...

Typedefs

typedef
log4cplus::thread::SyncGuard
< LockFile
LockFileGuard
typedef std::ptrdiff_t SOCKET_TYPE
typedef SOCKET os_socket_type

Enumerations

enum  SocketState {
  ok, not_opened, bad_address, connection_failed,
  broken_pipe, invalid_access_mode, message_truncated
}

Functions

LOG4CPLUS_EXPORT int getFileInfo (FileInfo *fi, tstring const &name)
 OS independent abstraction of stat() function.
LOG4CPLUS_EXPORT LogLoggetLogLog ()
LOG4CPLUS_EXPORT void sleep (unsigned long secs, unsigned long nanosecs=0)
LOG4CPLUS_EXPORT void sleepmillis (unsigned long millis)
LOG4CPLUS_EXPORT SOCKET_TYPE openSocket (unsigned short port, SocketState &state)
LOG4CPLUS_EXPORT SOCKET_TYPE connectSocket (const log4cplus::tstring &hostn, unsigned short port, bool udp, SocketState &state)
LOG4CPLUS_EXPORT SOCKET_TYPE acceptSocket (SOCKET_TYPE sock, SocketState &state)
LOG4CPLUS_EXPORT int closeSocket (SOCKET_TYPE sock)
LOG4CPLUS_EXPORT long read (SOCKET_TYPE sock, SocketBuffer &buffer)
LOG4CPLUS_EXPORT long write (SOCKET_TYPE sock, const SocketBuffer &buffer)
LOG4CPLUS_EXPORT long write (SOCKET_TYPE sock, const std::string &buffer)
LOG4CPLUS_EXPORT tstring getHostname (bool fqdn)
LOG4CPLUS_EXPORT int setTCPNoDelay (SOCKET_TYPE, bool)
LOG4CPLUS_EXPORT log4cplus::tstring toUpper (const log4cplus::tstring &s)
 Returns s in upper case.
LOG4CPLUS_EXPORT log4cplus::tstring toLower (const log4cplus::tstring &s)
 Returns s in lower case.
template<class StringType , class OutputIter >
void tokenize (const StringType &s, typename StringType::value_type c, OutputIter result, bool collapseTokens=true)
 Tokenize s using c as the delimiter and put the resulting tokens in _result.
template<class intType >
void convertIntegerToString (tstring &str, intType value)
template<class intType >
tstring convertIntegerToString (intType value)
LOG4CPLUS_EXPORT const
log4cplus::helpers::Time 
operator+ (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs)
LOG4CPLUS_EXPORT const
log4cplus::helpers::Time 
operator- (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs)
LOG4CPLUS_EXPORT const
log4cplus::helpers::Time 
operator/ (const log4cplus::helpers::Time &lhs, long rhs)
LOG4CPLUS_EXPORT const
log4cplus::helpers::Time 
operator* (const log4cplus::helpers::Time &lhs, long rhs)
LOG4CPLUS_EXPORT bool operator< (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
LOG4CPLUS_EXPORT bool operator<= (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
LOG4CPLUS_EXPORT bool operator> (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
LOG4CPLUS_EXPORT bool operator>= (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
LOG4CPLUS_EXPORT bool operator== (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
LOG4CPLUS_EXPORT bool operator!= (const log4cplus::helpers::Time &lhs, const log4cplus::helpers::Time &rhs) LOG4CPLUS_ATTRIBUTE_PURE
static os_socket_type to_os_socket (SOCKET_TYPE const &x)
static SOCKET_TYPE to_log4cplus_socket (os_socket_type const &x)
static void set_last_socket_error (int err)
static int get_last_socket_error ()
LOG4CPLUS_EXPORT void convertToBuffer (SocketBuffer &buffer, const log4cplus::spi::InternalLoggingEvent &event, const log4cplus::tstring &serverName)
LOG4CPLUS_EXPORT
log4cplus::spi::InternalLoggingEvent 
readFromBuffer (SocketBuffer &buffer)
std::string tostring (char const *str)
std::string tostring (std::string const &str)
std::string const & tostring (std::string &str)
std::wstring towstring (wchar_t const *str)
std::wstring towstring (std::wstring const &str)
std::wstring const & towstring (std::wstring &str)
LOG4CPLUS_EXPORT std::string tostring (const std::wstring &)
LOG4CPLUS_EXPORT std::string tostring (wchar_t const *)
LOG4CPLUS_EXPORT std::wstring towstring (const std::string &)
LOG4CPLUS_EXPORT std::wstring towstring (char const *)

Variables

LOG4CPLUS_EXPORT SOCKET_TYPE const INVALID_SOCKET_VALUE
os_socket_type const INVALID_OS_SOCKET_VALUE = INVALID_SOCKET

Typedef Documentation

Definition at line 62 of file lockfile.h.

Definition at line 67 of file internal/socket.h.

typedef std::ptrdiff_t log4cplus::helpers::SOCKET_TYPE

Definition at line 49 of file helpers/socket.h.


Enumeration Type Documentation

Enumerator:
ok 
not_opened 
bad_address 
connection_failed 
broken_pipe 
invalid_access_mode 
message_truncated 

Definition at line 40 of file helpers/socket.h.


Function Documentation

LOG4CPLUS_EXPORT SOCKET_TYPE log4cplus::helpers::acceptSocket ( SOCKET_TYPE  sock,
SocketState &  state 
)
LOG4CPLUS_EXPORT SOCKET_TYPE log4cplus::helpers::connectSocket ( const log4cplus::tstring hostn,
unsigned short  port,
bool  udp,
SocketState &  state 
)
template<class intType >
void log4cplus::helpers::convertIntegerToString ( tstring &  str,
intType  value 
) [inline]

Definition at line 157 of file stringhelper.h.

References LOG4CPLUS_TEXT.

Referenced by convertIntegerToString().

template<class intType >
tstring log4cplus::helpers::convertIntegerToString ( intType  value) [inline]

Definition at line 199 of file stringhelper.h.

References convertIntegerToString().

LOG4CPLUS_EXPORT void log4cplus::helpers::convertToBuffer ( SocketBuffer &  buffer,
const log4cplus::spi::InternalLoggingEvent event,
const log4cplus::tstring serverName 
)
static int log4cplus::helpers::get_last_socket_error ( ) [inline, static]

Definition at line 107 of file internal/socket.h.

LOG4CPLUS_EXPORT int log4cplus::helpers::getFileInfo ( FileInfo *  fi,
tstring const &  name 
)

OS independent abstraction of stat() function.

LOG4CPLUS_EXPORT SOCKET_TYPE log4cplus::helpers::openSocket ( unsigned short  port,
SocketState &  state 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator!= ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT const log4cplus::helpers::Time log4cplus::helpers::operator* ( const log4cplus::helpers::Time lhs,
long  rhs 
)
LOG4CPLUS_EXPORT const log4cplus::helpers::Time log4cplus::helpers::operator+ ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT const log4cplus::helpers::Time log4cplus::helpers::operator- ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT const log4cplus::helpers::Time log4cplus::helpers::operator/ ( const log4cplus::helpers::Time lhs,
long  rhs 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator< ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator<= ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator== ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator> ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT bool log4cplus::helpers::operator>= ( const log4cplus::helpers::Time lhs,
const log4cplus::helpers::Time rhs 
)
LOG4CPLUS_EXPORT long log4cplus::helpers::read ( SOCKET_TYPE  sock,
SocketBuffer &  buffer 
)
static void log4cplus::helpers::set_last_socket_error ( int  err) [inline, static]

Definition at line 99 of file internal/socket.h.

LOG4CPLUS_EXPORT int log4cplus::helpers::setTCPNoDelay ( SOCKET_TYPE  ,
bool   
)
LOG4CPLUS_EXPORT void log4cplus::helpers::sleep ( unsigned long  secs,
unsigned long  nanosecs = 0 
)
LOG4CPLUS_EXPORT void log4cplus::helpers::sleepmillis ( unsigned long  millis)
static SOCKET_TYPE log4cplus::helpers::to_log4cplus_socket ( os_socket_type const &  x) [inline, static]

Definition at line 91 of file internal/socket.h.

static os_socket_type log4cplus::helpers::to_os_socket ( SOCKET_TYPE const &  x) [inline, static]

Definition at line 83 of file internal/socket.h.

template<class StringType , class OutputIter >
void log4cplus::helpers::tokenize ( const StringType &  s,
typename StringType::value_type  c,
OutputIter  result,
bool  collapseTokens = true 
) [inline]

Tokenize s using c as the delimiter and put the resulting tokens in _result.

If collapseTokens is false, multiple adjacent delimiters will result in zero length tokens.

Example:

   string s = // Set string with '.' as delimiters
   list<log4cplus::tstring> tokens;
   tokenize(s, '.', back_insert_iterator<list<string> >(tokens));
 

Definition at line 70 of file stringhelper.h.

Returns s in lower case.

std::string log4cplus::helpers::tostring ( char const *  str) [inline]

Definition at line 47 of file tstring.h.

std::string log4cplus::helpers::tostring ( std::string const &  str) [inline]

Definition at line 54 of file tstring.h.

std::string const& log4cplus::helpers::tostring ( std::string &  str) [inline]

Definition at line 61 of file tstring.h.

LOG4CPLUS_EXPORT std::string log4cplus::helpers::tostring ( const std::wstring &  )
LOG4CPLUS_EXPORT std::string log4cplus::helpers::tostring ( wchar_t const *  )

Returns s in upper case.

std::wstring log4cplus::helpers::towstring ( wchar_t const *  str) [inline]

Definition at line 80 of file tstring.h.

std::wstring log4cplus::helpers::towstring ( std::wstring const &  str) [inline]

Definition at line 87 of file tstring.h.

std::wstring const& log4cplus::helpers::towstring ( std::wstring &  str) [inline]

Definition at line 94 of file tstring.h.

LOG4CPLUS_EXPORT std::wstring log4cplus::helpers::towstring ( const std::string &  )
LOG4CPLUS_EXPORT std::wstring log4cplus::helpers::towstring ( char const *  )
LOG4CPLUS_EXPORT long log4cplus::helpers::write ( SOCKET_TYPE  sock,
const SocketBuffer &  buffer 
)
LOG4CPLUS_EXPORT long log4cplus::helpers::write ( SOCKET_TYPE  sock,
const std::string &  buffer 
)

Variable Documentation

Definition at line 75 of file internal/socket.h.