本文整理匯總了C++中string_t::append方法的典型用法代碼示例。如果您正苦於以下問題:C++ string_t::append方法的具體用法?C++ string_t::append怎麽用?C++ string_t::append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類string_t
的用法示例。
在下文中一共展示了string_t::append方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: get_value
bool C_GeneratorConfig::get_value (T_GeneratorConfigOption P_opt,
string_t& P_val) {
bool L_ret = true ;
switch (P_opt) {
case E_CFG_OPT_LOG_FILE :
P_val = "" ;
if (m_option_log_file != NULL) {
P_val.append(m_option_log_file);
}
break ;
case E_CFG_OPT_LOG_STAT_FILE :
P_val = "" ;
if (m_log_stat_file != NULL) {
P_val.append(m_log_stat_file);
}
break ;
case E_CFG_OPT_RESP_TIME_REPART :
P_val = "" ;
if (m_resp_time_repart != NULL) {
P_val.append(m_resp_time_repart);
}
break ;
case E_CFG_OPT_DATA_LOG_FILE :
P_val = "" ;
if (m_data_log_file != NULL) {
P_val.append(m_data_log_file);
}
break ;
case E_CFG_OPT_LOG_PROTOCOL_STAT_FILE :
P_val = "" ;
if (m_log_protocol_stat_file != NULL) {
P_val.append(m_log_protocol_stat_file);
}
break ;
default:
L_ret = false ;
break ;
} // switch
return (L_ret) ;
}
示例2: switch
virtual bool read_http
(talas::protocol::tls::connection& connection, string_t& message) {
bool success = false;
ssize_t count = 0, amount = 0;
char http = 0, last = 0;
int eol = 0;
TALAS_LOG_DEBUG("connection.read(&http, 1)...");
for (bool done = false; !done; ) {
if (0 < (amount = connection.read(&http, 1))) {
count += amount;
message.append(&http, 1);
switch(http) {
case '\r':
if ('\n' != last) {
eol = 0;
} else {}
break;
case '\n':
if ('\r' != last) {
eol = 0;
} else {
if (eol++) {
done = true;
}
}
break;
default:
eol = 0;
break;
}
last = http;
} else {
done = true;
}
}
if (0 < (amount)) {
TALAS_LOG_DEBUG("...count = " << count << " = connection.read(&http, 1)...");
success = true;
}
return success;
}