本文整理汇总了C++中DString::append方法的典型用法代码示例。如果您正苦于以下问题:C++ DString::append方法的具体用法?C++ DString::append怎么用?C++ DString::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DString
的用法示例。
在下文中一共展示了DString::append方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void DProcess::run()
{
DString buffer;
DString cmode;
DStringList::iterator it;
char * buf;
int bufsize = 80 * sizeof( char );
// construct exe line
buffer = m_exe;
for ( it = m_args.begin() ; it != m_args.end() ; ++it )
{
if ( !buffer.isEmpty() )
{
buffer.append( " " );
}
buffer.append( *it );
}
if ( m_com_mode == READ_ONLY)
{
cmode = "r";
}
else
{
cmode = "w";
}
m_file = popen( buffer.c_str(), cmode.c_str() );
if ( !m_file )
{
return;
}
if ( m_com_mode == READ_ONLY)
{
buf = new char[ bufsize ];
while ( fgets( buf, bufsize, m_file ) != 0 )
{
addOutput( buf );
}
delete[]( buf );
}
pclose( m_file );
m_file = 0;
}
示例2: insert
void DLogEngineSyslog::insert ( const DString & text, Level loglevel )
{
int sysloglevel = LOG_DEBUG;
DString message;
// write message only if loglevel is highter or equal to minimum log level
// or not equal to NONE
if ( ( loglevel < m_minLevel ) && ( loglevel != DLogShared::NONE ) )
{
return;
}
switch ( loglevel )
{
case DLogShared::NONE:
case DLogShared::DEBUG:
{
sysloglevel = LOG_DEBUG;
break;
}
case DLogShared::VERBOSE:
{
sysloglevel = LOG_NOTICE;
break;
}
case DLogShared::INFO:
{
sysloglevel = LOG_INFO;
break;
}
case DLogShared::SIGNALS:
{
sysloglevel = LOG_INFO;
break;
}
case DLogShared::WARNING:
{
sysloglevel = LOG_WARNING;
break;
}
case DLogShared::ERROR:
{
sysloglevel = LOG_ERR;
break;
}
case DLogShared::CRITICAL:
{
sysloglevel = LOG_CRIT;
break;
}
}
message = "[";
message.append( DLogParams::toString( loglevel ) );
message.append( "] " );
message.append( text );
syslog ( sysloglevel, "%s", message.c_str() );
}