本文整理汇总了C++中DataStream::flush方法的典型用法代码示例。如果您正苦于以下问题:C++ DataStream::flush方法的具体用法?C++ DataStream::flush怎么用?C++ DataStream::flush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataStream
的用法示例。
在下文中一共展示了DataStream::flush方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readSettings
void readSettings() {
int n,cc;
char ch, buff[24];
char buff2[80];
unsigned int ndx=0;
int read=0;
if (!settingsFile.open(&root, settingsFileName, O_READ)) {
console.printf("DBG: Creating New Settings File\r\n"); console.flush();
writeSettings();
return;
}
console.printf("DBG: Opened Settings File: %s\r\n",settingsFileName);
settingsFile.seekSet(0);
while ((read=settingsFile.read(buff, sizeof(buff))) > 0) {
//console.printf("DBG: READ %d\r\n",read); console.flush();
for (cc=0; cc < read ; cc++) {
ch=buff[cc];
//console.putChar(ch); console.flush();
buff2[ndx]=ch;
if (ndx<MAX_INPUT_LINE) {ndx++;}
if (ch=='\n'){//console.putChar('\r');
if(ndx) {
ndx--; // eat the newline.
}
buff2[ndx]='\0';
//console.puts(buff2);
if ((ndx>4) && buff2[3]=='!') {//fix this when the files are better
buff2[3]='\0';
n=lookupIndex(buff2);
switch (n) {
case _NPW_:
networkSetPassword(buff2+4);
break;
case _NJN_:
Watchdog_Reset();
networkJoin(buff2 +4);
break;
case _PKY_:
strncpy(pachubeKey, buff2+4, MAX_PATCHUBE_KEY_LENGHT-1);
break;
case _PFD_:
strncpy(pachubeFeed, buff2+4, MAX_PATCHUBE_FEED_LENGHT-1);
break;
default:
break;
}
}
ndx=0;
}
}
}
console.printf("DBG: Finished with Settings File: %s\r\n",settingsFileName);
settingsFile.close();
}