Logo Search packages:      
Sourcecode: nemiver version File versions

LogStream & nemiver::common::LogStream::write ( const char *  a_buf,
long  a_buflen = -1,
const string &  a_domain = NMV_GENERAL_DOMAIN 
)

writes a text string to the stream

Parameters:
a_buf the buffer that contains the text string.
a_buflen the length of the buffer. If <0, a_buf is considered as a zero terminated string.
a_domain the domain the string has to be logged against.

Definition at line 400 of file nmv-log-stream.cc.

Referenced by operator<<(), and write().

{
    if (!m_priv->is_logging_allowed (a_domain))
        return *this ;

    long len = 0 ;
    if (a_buflen > 0) {
        len = a_buflen ;
    } else {
        if (!a_buf)
            len = 0 ;
        else
            len = strlen (a_buf) ;
    }
    m_priv->sink->write (a_buf, len) ;
    if (m_priv->sink->bad ()) {
        cerr << "write failed\n" ;
        throw Exception ("write failed") ;
    }
    return *this ;
}


Generated by  Doxygen 1.6.0   Back to index