本文整理汇总了C++中AString::contains方法的典型用法代码示例。如果您正苦于以下问题:C++ AString::contains方法的具体用法?C++ AString::contains怎么用?C++ AString::contains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AString
的用法示例。
在下文中一共展示了AString::contains方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: msg
bool AFramework::MTempMaster::networkConfig(){
AString dataRcv;
if(!m_flag){
return false;
}
msg("Configurazione\nRete...");
if(prepareAp(_MTEMP_SSID_AP, _MTEMP_PWD_AP, _MTEMP_PORT_AP)){
msg("In attesa di\nConnessioni...", 0);
while(1){
if(m_wifi->waitForData(dataRcv)){
if(dataRcv.contains(_MTEMP_CONF)){
msg("Dati ricevuti,\nSalvataggio...");
if(saveNetworkConfig(dataRcv)){
msg("Salvataggio ok!", 0);
if(m_wifi->send(_MTEMP_BOARD_OK)){
if(defaultProgram()){
msg("Avvio tra\n1 secondo...");
return true;
}else{
msg("Errore!");
return false;
}
}
}else{
m_wifi->send(_MTEMP_BOARD_FAIL);
msg("Errore\nConfigurazione!");
return false;
}
}
}
}
}
}
示例2: wasSuccess
void SmartMote::wasSuccess(const AString & str){
if(str.contains("OK")){
for(uint8 i = 0; i < 4; i++){
turnOffGreen();
System::delay(125);
turnOnGreen();
System::delay(125);
}
}else{
for(uint8 i = 0; i < 4; i++){
turnOnRed();
System::delay(125);
turnOffRed();
System::delay(125);
}
}
}
示例3: parse_line
void Data::parse_line(AString line) {
line = line.strip(" \t");
if (line.startswith("#")) return;
if (line.contains('=')) {
std::vector<AString> vec = line.split("=");
vec[0] = vec[0].strip(" ");
if (vec[1].contains('#'))
vec[1] = vec[1].lpartition("#")[0];
vec[1] = vec[1].strip(" ");
values[current_category][vec[0]] = vec[1];
}
else {
if (line.startswith("[")) {
current_category = line.strip("[]");
}
}
//if (line.length() == 0) return;
//int stage = 0;
//AString field;
//AString value;
//AString category;
//for (unsigned int i = 0; i < line.length(); i++) {
//char c = line[i];
//if (stage == 0) {
//if ( (c == ' ') || (c == '\t') )
//continue;
//else if (c == '=')
//stage = 1;
//else if (c == '#')
//return;
//else if (c == '[')
//stage = 3;
//else
//field += c;
//}
//else if (stage == 1) {
//if ( (c == ' ') || (c == '\t') )
//continue;
//else {
//stage = 2;
//value += c;
//}
//}
//else if (stage == 2) {
//value += c;
//}
//else if (stage == 3) {
//if ( c == ']' ) {
//current_category = category;
//return;
//}
//else
//category += c;
//}
//}
//this->values[current_category][field] = value;
}