当前位置: 首页>>代码示例>>C++>>正文


C++ StaticString::clear方法代码示例

本文整理汇总了C++中StaticString::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ StaticString::clear方法的具体用法?C++ StaticString::clear怎么用?C++ StaticString::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StaticString的用法示例。


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

示例1: Clear

 void Clear() {
   port_type = DISABLED;
   baud_rate = 4800u;
   path.clear();
   bluetooth_mac.clear();
   driver_name.clear();
 }
开发者ID:joachimwieland,项目名称:xcsoar-jwieland,代码行数:7,代码来源:DeviceConfig.hpp

示例2: Set

    void Set(const TCHAR *_name, const DownloadStatus *_download_status,
             bool _failed) {
      name = _name;

      TCHAR path[MAX_PATH];
      LocalPath(path, name);

      if (File::Exists(path)) {
        FormatByteSize(size.buffer(), size.MAX_SIZE,
                       File::GetSize(path));
#ifdef HAVE_POSIX
        FormatISO8601(last_modified.buffer(),
                      BrokenDateTime::FromUnixTimeUTC(File::GetLastModification(path)));
#else
        // XXX implement
        last_modified.clear();
#endif
      } else {
        size.clear();
        last_modified.clear();
      }

      downloading = _download_status != NULL;
      if (downloading)
        download_status = *_download_status;

      failed = _failed;
    }
开发者ID:DRIZO,项目名称:xcsoar,代码行数:28,代码来源:FileManager.cpp

示例3: AddReadOnly

void
ManageV7Widget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  StaticString<64> buffer;

  if (!info.product.empty()) {
    buffer.clear();
    buffer.UnsafeAppendASCII(info.product.c_str());
    AddReadOnly(_("Product"), NULL, buffer.c_str());
  }

  if (!info.serial.empty()) {
    buffer.clear();
    buffer.UnsafeAppendASCII(info.serial.c_str());
    AddReadOnly(_("Serial"), NULL, buffer.c_str());
  }

  if (!info.hardware_version.empty()) {
    buffer.clear();
    buffer.UnsafeAppendASCII(info.hardware_version.c_str());
    AddReadOnly(_("Hardware version"), NULL, buffer.c_str());
  }

  if (!info.software_version.empty()) {
    buffer.clear();
    buffer.UnsafeAppendASCII(info.software_version.c_str());
    AddReadOnly(_("Firmware version"), NULL, buffer.c_str());
  }

  AddButton(_("Setup"), this, SETUP);
}
开发者ID:damianob,项目名称:xcsoar,代码行数:31,代码来源:ManageV7Dialog.cpp

示例4: if

inline void
WifiListWidget::Connect()
{
  if (!EnsureConnected()) {
    ShowMessageBox(_T("Network failure"), _("Connect"), MB_OK);
    return;
  }

  const unsigned i = GetList().GetCursorIndex();
  if (i >= networks.size())
    return;

  const auto &info = networks[i];
  if (info.id < 0) {
    const auto ssid = info.ssid;

    StaticString<256> caption;
    caption.Format(_("Passphrase of network '%s'"), ssid.c_str());

    StaticString<32> passphrase;
    passphrase.clear();
    if (info.security == OPEN_SECURITY)
      passphrase.clear();
    else if (!TextEntryDialog(passphrase, caption, false))
      return;

    if (!WifiConnect(info.security, wpa_supplicant, info.ssid, passphrase))
      ShowMessageBox(_T("Network failure"), _("Connect"), MB_OK);
  } else {
    if (!wpa_supplicant.RemoveNetwork(info.id) || !wpa_supplicant.SaveConfig())
      ShowMessageBox(_T("Error"), _("Remove"), MB_OK);
  }

  UpdateList();
}
开发者ID:,项目名称:,代码行数:35,代码来源:

示例5: clear

 void clear() {
   event_id = 0;
   location = 0;
   mode.clear();
   type.clear();
   data.clear();
   label.clear();
 }
开发者ID:Tjeerdm,项目名称:XCSoarDktjm,代码行数:8,代码来源:InputParser.cpp

示例6: free

static void
LoadChecklist()
{
  nLists = 0;

  free(ChecklistText[0]);
  ChecklistText[0] = NULL;

  free(ChecklistTitle[0]);
  ChecklistTitle[0] = NULL;

  TLineReader *reader = OpenDataTextFile(_T(XCSCHKLIST));
  if (reader == NULL) {
    addChecklist(_("No checklist loaded"), _("Create xcsoar-checklist.txt"));
    return;
  }

  StaticString<MAXDETAILS> Details;
  TCHAR Name[100];
  bool inDetails = false;
  int i;

  Details.clear();
  Name[0] = 0;

  TCHAR *TempString;
  while ((TempString = reader->ReadLine()) != NULL) {
    // Look for start
    if (TempString[0] == '[') {
      if (inDetails) {
        addChecklist(Name, Details);
        Details.clear();
        Name[0] = 0;
      }

      // extract name
      for (i = 1; i < MAXTITLE; i++) {
        if (TempString[i] == ']')
          break;

        Name[i - 1] = TempString[i];
      }
      Name[i - 1] = 0;

      inDetails = true;
    } else {
      // append text to details string
      Details.append(TempString);
      Details.Append(_T('\n'));
    }
  }

  delete reader;

  if (inDetails) {
    addChecklist(Name, Details);
  }
}
开发者ID:,项目名称:,代码行数:58,代码来源:

示例7: LoadFlarmDatabases

void
InputEvents::eventFlarmDetails(gcc_unused const TCHAR *misc)
{
  LoadFlarmDatabases();

  StaticString<4> callsign;
  callsign.clear();
  if (!TextEntryDialog(CommonInterface::main_window, callsign,
                       _("Competition ID")) ||
      callsign.empty())
    return;

  FlarmId ids[30];
  unsigned count = FlarmDetails::FindIdsByCallSign(callsign, ids, 30);

  if (count > 0) {
    FlarmId id = dlgFlarmDetailsListShowModal(
        XCSoarInterface::main_window, _("Show details:"), ids, count);

    if (id.IsDefined())
      dlgFlarmTrafficDetailsShowModal(id);
  } else {
    ShowMessageBox(_("Unknown competition number"),
                _("Not found"), MB_OK | MB_ICONINFORMATION);
  }
}
开发者ID:damianob,项目名称:xcsoar,代码行数:26,代码来源:InputEventsActions.cpp

示例8: Clear

  void Clear() {
    port_type = PortType::DISABLED;
    baud_rate = 4800u;
    bulk_baud_rate = 0u;
    network_port = 4353u;
    path.clear();
    bluetooth_mac.clear();
    driver_name.clear();
    sync_from_device = true;
    sync_to_device = true;
    k6bt = false;
#ifndef NDEBUG
    dump_port = false;
#endif
    ignore_checksum = false;
  }
开发者ID:damianob,项目名称:xcsoar_mess,代码行数:16,代码来源:DeviceConfig.hpp

示例9: tstring

const tstring 
AirspaceAltitude::GetAsTextUnits(const bool concise) const
{
  StaticString<64> buffer;

  switch (type) {
  case AGL:
    if (!positive(altitude_above_terrain))
      buffer = _T("GND");
    else
      buffer.Format(_T("%d %s AGL"),
                    iround(Units::ToUserAltitude(altitude_above_terrain)),
                    Units::GetAltitudeName());
    break;
  case FL:
    buffer.Format(_T("FL%d"), (int)flight_level);
    break;
  case MSL:
    buffer.Format(_T("%d %s"), iround(Units::ToUserAltitude(altitude)),
                  Units::GetAltitudeName());
    break;
  case UNDEFINED:
  default:
    buffer.clear();
    break;
  }

  if (!concise && type != MSL && positive(altitude))
    buffer.AppendFormat(_T(" %d %s"), iround(Units::ToUserAltitude(altitude)),
                        Units::GetAltitudeName());

  return tstring(buffer);
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例10: AddBoolean

void
TrackingConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
  const TrackingSettings &settings =
    CommonInterface::GetComputerSettings().tracking;

  RowFormWidget::Prepare(parent, rc);

#ifdef HAVE_SKYLINES_TRACKING
  AddBoolean(_T("SkyLines"), NULL, settings.skylines.enabled, this);
  AddTime(_("Tracking Interval"), NULL, 5, 1200, 5,
          settings.skylines.interval);

#ifdef HAVE_SKYLINES_TRACKING_HANDLER
  AddBoolean(_("Track friends"),
             _("Download the position of your friends live from the SkyLines server."),
             settings.skylines.traffic_enabled, this);
#endif

  StaticString<64> buffer;
  if (settings.skylines.key != 0)
    buffer.UnsafeFormat(_T("%llX"), (unsigned long long)settings.skylines.key);
  else
    buffer.clear();
  AddText(_T("Key"), NULL, buffer);
#endif

#if defined(HAVE_SKYLINES_TRACKING) && defined(HAVE_LIVETRACK24)
  AddSpacer();
#endif

#ifdef HAVE_LIVETRACK24
  AddBoolean(_T("LiveTrack24"),  _T(""), settings.livetrack24.enabled, this);

  AddTime(_("Tracking Interval"), _T(""), 5, 3600, 5, settings.interval);

  AddEnum(_("Vehicle Type"), _("Type of vehicle used."), vehicle_type_list,
          (unsigned) settings.vehicleType);

  WndProperty *edit = AddEnum(_("Server"), _T(""), server_list, 0);
  ((DataFieldEnum *)edit->GetDataField())->Set(settings.livetrack24.server);
  edit->RefreshDisplay();

  AddText(_("Username"), _T(""), settings.livetrack24.username);
  AddPassword(_("Password"), _T(""), settings.livetrack24.password);
#endif

#ifdef HAVE_SKYLINES_TRACKING
  SetSkyLinesEnabled(settings.skylines.enabled);
#endif

#ifdef HAVE_LIVETRACK24
  SetEnabled(settings.livetrack24.enabled);
#endif
}
开发者ID:DRIZO,项目名称:xcsoar,代码行数:55,代码来源:TrackingConfigPanel.cpp

示例11: SaveFlarmNames

/**
 * This event handler is called when the "Change Callsign" button is pressed
 */
inline void
FlarmTrafficDetailsWidget::OnCallsignClicked()
{
  StaticString<21> newName;
  newName.clear();
  if (TextEntryDialog(newName, _("Competition ID")) &&
      FlarmDetails::AddSecondaryItem(target_id, newName))
    SaveFlarmNames();

  Update();
}
开发者ID:Andy-1954,项目名称:XCSoar,代码行数:14,代码来源:FlarmTrafficDetails.cpp

示例12: Update

/**
 * This event handler is called when the "Change Callsign" button is pressed
 */
static void
OnCallsignClicked(gcc_unused WndButton &Sender)
{
  StaticString<21> newName;
  newName.clear();
  if (TextEntryDialog(XCSoarInterface::main_window, newName,
                      _("Competition ID")) &&
      FlarmDetails::AddSecondaryItem(target_id, newName))
    FlarmDetails::SaveSecondary();

  Update();
}
开发者ID:macsux,项目名称:XCSoar,代码行数:15,代码来源:dlgFlarmTrafficDetails.cpp

示例13: Item

    explicit Item(uint32_t _id, uint32_t _time_of_day_ms,
                  const GeoPoint &_location, int _altitude,
                  std::string &&_name)
      :id(FlarmId::Undefined()), skylines_id(_id),
       time_of_day_ms(_time_of_day_ms),
       color(FlarmColor::COUNT),
       loaded(false),
       location(_location),
       vector(GeoVector::Invalid()), name(std::move(_name)),
       altitude(_altitude) {
      assert(IsSkyLines());

      near_name.clear();
    }
开发者ID:MaxPower-No1,项目名称:XCSoar,代码行数:14,代码来源:TrafficList.cpp

示例14: lease

static void
UpdateNameButton()
{
  StaticString<80u> buffer;

  {
    ProtectedTaskManager::Lease lease(*protected_task_manager);
    const OrderedTask &task = lease->GetOrderedTask();
    if (target_point < task.TaskSize()) {
      const OrderedTaskPoint &tp = task.GetTaskPoint(target_point);
      buffer.Format(_T("%u: %s"), target_point,
                    tp.GetWaypoint().name.c_str());
    } else
      buffer.clear();
  }

  WndButton &name_button = *(WndButton *)wf->FindByName(_T("Name"));
  name_button.SetText(buffer);
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:19,代码来源:TargetDialog.cpp

示例15: LocalPath

inline void
ProfileListWidget::NewClicked()
{
  StaticString<64> name;
  name.clear();
  if (!TextEntryDialog(name, _("Profile name")))
      return;

  StaticString<80> filename;
  filename = name;
  filename += _T(".prf");

  StaticString<MAX_PATH> path;
  LocalPath(path.buffer(), filename);

  if (!File::CreateExclusive(path)) {
    ShowMessageBox(name, _("File exists already."), MB_OK|MB_ICONEXCLAMATION);
    return;
  }

  UpdateList();
  SelectPath(path);
}
开发者ID:M-Scholli,项目名称:XCSoar,代码行数:23,代码来源:ProfileListDialog.cpp


注:本文中的StaticString::clear方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。