您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ F函数代码示例

51自学网 2021-06-01 20:40:15
  C++
这篇教程C++ F函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中F函数的典型用法代码示例。如果您正苦于以下问题:C++ F函数的具体用法?C++ F怎么用?C++ F使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了F函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: parseFileName

void  MyFunctionRequestHandler::upload(ESP8266WebServer& server, String requestUri, HTTPUpload& upload){  //Serial.println(String(F("upload(")) + requestUri + String(F(")")));  String filename = parseFileName(upload.filename);  if (filename.endsWith(".bin")) { // handle firmware upload    mbRebootRequired = true;    if (upload.status == UPLOAD_FILE_START) {      if (mDebug) Serial.println("Update: " + upload.filename);      uint32_t maxSketchSpace = (ESP.getFreeSketchSpace() - 0x1000) & 0xFFFFF000;      if (!Update.begin(maxSketchSpace)) { //start with max available size        if (mDebug) Update.printError(Serial);      }    } else if (upload.status == UPLOAD_FILE_WRITE) {      if (mDebug) Serial.print(".");      if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {        if (mDebug) Update.printError(Serial);      }    } else if (upload.status == UPLOAD_FILE_END) {      miUploadSize = Update.size();      if (Update.end(true)) { //true to set the size to the current progress        if (mDebug) Serial.println(String(F("Update Success - uploaded: ")) + String(upload.totalSize) + String(F(".... rebooting now!")));      } else {        if (mDebug) Update.printError(Serial);      }      if (mDebug) Serial.setDebugOutput(false);    } else if (upload.status == UPLOAD_FILE_ABORTED) {      miUploadSize = Update.size();      Update.end();      if (mDebug) Serial.println(F("Update was aborted"));    }  } else { // handle file upload    mbRebootRequired = false;    if (upload.status == UPLOAD_FILE_START) {      if (mDebug) Serial.println(String(F("uploading to SPIFFS: /")) + filename);      mUploadFile = SPIFFS.open("/" + filename, "w");    } else if (upload.status == UPLOAD_FILE_WRITE) {      if (mDebug) Serial.print(".");      if (mUploadFile.write(upload.buf, upload.currentSize) != upload.currentSize) {        if (mDebug) Serial.println(String(F("ERROR writing file ")) + String(mUploadFile.name()) + String(F("to SPIFFS.")));        mUploadFile.close();      }    } else if (upload.status == UPLOAD_FILE_END) {      miUploadSize = upload.totalSize;      if (mUploadFile.size() == upload.totalSize) {        if (mDebug) Serial.println(String(F("Upload to SPIFFS Succeeded - uploaded: ")) + String(upload.totalSize) + String(F(".... rebooting now!")));      } else {        if (mDebug) Serial.println(String(F("Upload to SPIFFS FAILED: ")) + String(mUploadFile.size()) + String(F(" bytes of ")) + String(upload.totalSize));      }      mUploadFile.close();      if (!upload.totalSize){        if (mDebug) Serial.println("Removing: " + filename);        SPIFFS.remove("/" + filename);      }    } else if (upload.status == UPLOAD_FILE_ABORTED) {      miUploadSize = upload.totalSize;      mUploadFile.close();      if (mDebug) Serial.println(F("Upload to SPIFFS was aborted"));    }  }}
开发者ID:Dynatrace,项目名称:ufo,代码行数:62,


示例2: F

void MyFunctionRequestHandler::infoHandler(ESP8266WebServer& server) {  String json = F("{");  json += '"'; json += F("heap"); json += '"';  json += ':';  json += '"'; json +=  String(ESP.getFreeHeap()); json += '"';  json += F(", ");   json += '"'; json += F("ssid"); json += '"';  json += ':';  json += '"'; json +=  String(WiFi.SSID()); json += '"';  json += F(", ");   json += '"'; json += F("ipaddress"); json += '"';  json += ':';  json += '"'; json +=  WiFi.localIP().toString(); json += '"';  json += F(", ");   json += '"'; json += F("ipgateway"); json += '"';  json += ':';  json += '"'; json +=  WiFi.gatewayIP().toString(); json += '"';  json += F(", ");   json += '"'; json += F("ipdns"); json += '"';  json += ':';  json += '"'; json += WiFi.dnsIP().toString(); json += '"';  json += F(", ");   json += '"'; json += F("ipsubnetmask"); json += '"';  json += ':';  json += '"'; json +=  WiFi.subnetMask().toString(); json += '"';  json += F(", ");   json += '"'; json += F("macaddress"); json += '"';  json += ':';  json += '"'; json +=  WiFi.macAddress(); json += '"';  json += F(", ");   json += '"'; json += F("hostname"); json += '"';  json += ':';  json += '"'; json +=  WiFi.hostname(); json += '"';  json += F(", ");   json += '"'; json += F("apipaddress"); json += '"';  json += ':';  json += '"'; json +=  WiFi.softAPIP().toString(); json += '"';  json += F(", ");   json += '"'; json += F("apconnectedstations"); json += '"';  json += ':';  json += '"'; json += String(WiFi.softAPgetStationNum()); json += '"';  json += F(", ");   json += '"'; json += F("wifiautoconnect"); json += '"';  json += ':';  json += '"'; json += String(WiFi.getAutoConnect()); json += '"';  json += F(", ");   json += '"'; json += F("firmwareversion"); json += '"';  json += ':';  json += '"'; json += String(FIRMWARE_VERSION); json += '"';  json += '}';    server.sendHeader(F("cache-control"), F("private, max-age=0, no-cache, no-store"));  server.send(200, F("text/json"), json);}
开发者ID:Dynatrace,项目名称:ufo,代码行数:55,


示例3: ASSURE_OPTION

voidStyle::drawComboBox(const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const{    ASSURE_OPTION(cmb, ComboBox);    OPT_ENABLED OPT_HOVER OPT_FOCUS    SAVE_PAINTER(Pen|Brush|Alias);    if ( widget && widget->inherits("WebView") ) {        // paints hardcoded black text bypassing the style?! grrr...        const_cast<QStyleOptionComboBox*>(cmb)->palette.setColor(QPalette::Window, QColor(230,230,230,255));        widget = 0;    }    animStep = !widget ? MAX_STEPS*hover : Animator::Hover::step(widget);    QRect ar;    const QComboBox *combo = widget ? qobject_cast<const QComboBox*>(widget) : NULL;    if ((cmb->subControls & SC_ComboBoxArrow) && (!combo || combo->count() > 0)) {   // do we have an arrow?        ar = subControlRect(CC_ComboBox, cmb, SC_ComboBoxArrow, widget);        const int dx = (F(2) & ~1) / 2;        ar.translate(cmb->direction == Qt::LeftToRight ? -dx : dx, 0);    }    const bool listShown = combo && combo->view() && ((QWidget*)(combo->view()))->isVisible();    if (listShown) { // this messes up hover        hover = hover || QRect(widget->mapToGlobal(RECT.topLeft()), RECT.size()).contains(QCursor::pos()); // TODO Qt5, avoid asking for the cursor pos        animStep = MAX_STEPS;    }    QColor c = hasFocus ? FCOLOR(Highlight) : (cmb->editable ? FCOLOR(Text) : FCOLOR(WindowText));    if (cmb->editable) {        drawLineEditFrame(option, painter, widget);        c = FX::blend(FCOLOR(Base), c, MAX_STEPS, 1 + 2*animStep);    } else {        const int icon = cmb->currentIcon.isNull() ? 0 : cmb->iconSize.width() + F(4);        QFont fnt(painter->font());        fnt.setBold(true);        int text = QFontMetrics(fnt).width(cmb->currentText);        if (text)            text += F(4);        if (!(text+icon)) // webkit etc.            text = ar.left() - (F(16) + RECT.x());        painter->setRenderHint(QPainter::Antialiasing, true);        painter->setPen(QPen(hasFocus ? FCOLOR(Highlight) : FX::blend(FCOLOR(Window), c, 4, 1), FRAME_STROKE));        painter->setBrush(Qt::NoBrush);        const int y = ar.y() + ar.height()/2;        const int da = animStep * 168 / MAX_STEPS;        if (option->direction == Qt::LeftToRight) {            DRAW_SEGMENT(ar, 16*(120 - da/2), 16*(192+da));            painter->drawLine(RECT.x() + icon + text + F(6), y, ar.left()-F(2), y);        } else {            DRAW_SEGMENT(ar, 16*(30 + da/2), -16*(192+da));            painter->drawLine(RECT.right() - (icon + text + F(6)), y, ar.right()+F(2), y);        }        c = FX::blend(FCOLOR(Window), FCOLOR(WindowText), MAX_STEPS - animStep, 1 + animStep);    }    if (!isEnabled) {        RESTORE_PAINTER        return;    }
开发者ID:cazimi,项目名称:virtuality,代码行数:63,


示例4: F

 ~AutoPtr() {   if (mPtr)     F(mPtr); }
开发者ID:kenberland,项目名称:mozilla-gnome-keyring,代码行数:4,


示例5: F

  { "-seed",   OPT_INT,     &seed,   "Seed for random parameters." },  { "-points", OPT_INT,     &points, "Number of points to produce." },  { "-f0",     OPT_DOUBLE,  &f0,     "Initial fish population." },  { "-s0",     OPT_DOUBLE,  &s0,     "Initial shark population." },  { "-a",      OPT_DOUBLE,  &a,      "Fish growth rate." },  { "-b",      OPT_DOUBLE,  &b,      "Shark consumption rate." },  { "-c",      OPT_DOUBLE,  &c,      "Fish nutritional value." },  { "-d",      OPT_DOUBLE,  &d,      "Shark death rate." },  { "-dt",     OPT_DOUBLE,  &dt,     "Time step increment." },  { NULL,      OPT_NULL,    NULL,    NULL }};char help_string[] = "/Integrates the two-species Lotka-Volterra predator-prey system, //dF/dt = F(a - bS), dS/dt = S(cF - d), //according to the specified parameters./";/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *//* The two differential equations to integrate. */void myfunc(double x, double y, double *xx, double *yy){  *xx = x * (a - b * y);  *yy = y * (c * x - d);}/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
开发者ID:Stray,项目名称:CBofN,代码行数:31,


示例6: errorPrint

//------------------------------------------------------------------------------void SdFatBase::errorPrint(Print* pr, char const* msg) {  pr->print(F("error: "));  pr->println(msg);  errorPrint(pr);}
开发者ID:0x1abin,项目名称:Gamebuino,代码行数:6,


示例7: open

/** Open for reading** Returns true on success*/boolean SimpleConfig::open(boolean write){  mlog.WARNING(F("SimpleConfig::base class called"));  return false;}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:10,


示例8: close

/** Close file*/boolean SimpleConfig::close(){  mlog.WARNING(F("SimpleConfig::base class called"));  // if writeMode, then remember to terminate file   return false;}
开发者ID:digitalfotografen,项目名称:Arduino-Thingspeak,代码行数:9,


示例9: LAYOUT_65_ansi

   * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤   * │ TAB │  Q  │  W  │  E  │  R  │  T  │  Y  │  U  │  I  │  O  │  P  │  [  │  ]  │  /  │
C++ F2函数代码示例
C++ EyePosition函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。