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


C++ UnicodeString::data方法代码示例

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


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

示例1: tokenize

static void tokenize(const UnicodeString & str, rde::vector<UnicodeString> & tokens,
  const UnicodeString & delimiters = L" ", const bool trimEmpty = false)
{
  intptr_t lastPos = 0;
  while (true)
  {
    intptr_t pos = str.FindFirstOf(delimiters.c_str(), lastPos);
    if (pos == NPOS)
    {
       pos = str.Length();

       if (pos != lastPos || !trimEmpty)
       {
         tokens.push_back(
           UnicodeString(str.data() + lastPos, pos - lastPos));
       }
       break;
    }
    else
    {
      if (pos != lastPos || !trimEmpty)
      {
        tokens.push_back(
          UnicodeString(str.data() + lastPos, pos - lastPos));
      }
    }

    lastPos = pos + 1;
  }
}
开发者ID:gvsurenderreddy,项目名称:Far-NetBox,代码行数:30,代码来源:Classes.cpp

示例2: far_get_full_path

UnicodeString far_get_full_path(const UnicodeString& file_path) {
  const unsigned c_buf_size = 0x10000;
  UnicodeString full_path;
  int size = static_cast<int>(g_fsf.ConvertPath(CPM_FULL, file_path.data(), full_path.buf(c_buf_size), c_buf_size));
  if (size > c_buf_size) g_fsf.ConvertPath(CPM_FULL, file_path.data(), full_path.buf(size), size);
  full_path.set_size();
  return full_path;
}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:8,代码来源:util.cpp

示例3: reg_read_string

UnicodeString reg_read_string(HKEY hkey, const UnicodeString& name, const UnicodeString& def_value) {
  UnicodeString value = def_value;
  DWORD type = REG_SZ;
  DWORD data_size;
  // get string size
  LONG res = RegQueryValueExW(hkey, name.data(), NULL, &type, NULL, &data_size);
  if (res == ERROR_SUCCESS) {
    UnicodeString data;
    // get string value
    res = RegQueryValueExW(hkey, name.data(), NULL, &type, (LPBYTE) data.buf(data_size / sizeof(wchar_t)), &data_size);
    if (res == ERROR_SUCCESS) {
      data.set_size(data_size / sizeof(wchar_t) - 1); // throw away terminating NULL
      value = data;
    }
  }
  return value;
}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:17,代码来源:file_filters.cpp

示例4: set

 bool set(const wchar_t* name, const UnicodeString& value) {
   FarSettingsItem fsi = { sizeof(FarSettingsItem) };
   fsi.Root = 0;
   fsi.Name = name;
   fsi.Type = FST_STRING;
   fsi.String = value.data();
   return control(SCTL_SET, &fsi) != 0;
 }
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:8,代码来源:options.cpp

示例5: ExecuteShell

bool ExecuteShell(const UnicodeString & APath, const UnicodeString & Params,
  HANDLE & Handle)
{
  TShellExecuteInfoW ExecuteInfo;
  ::ZeroMemory(&ExecuteInfo, sizeof(ExecuteInfo));
  ExecuteInfo.cbSize = sizeof(ExecuteInfo);
  ExecuteInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
  ExecuteInfo.hwnd = reinterpret_cast<HWND>(::GetModuleHandle(0));
  ExecuteInfo.lpFile = const_cast<wchar_t *>(APath.data());
  ExecuteInfo.lpParameters = const_cast<wchar_t *>(Params.data());
  ExecuteInfo.nShow = SW_SHOW;

  bool Result = (::ShellExecuteEx(&ExecuteInfo) != 0);
  if (Result)
  {
    Handle = ExecuteInfo.hProcess;
  }
  return Result;
}
开发者ID:gumb0,项目名称:Far-NetBox,代码行数:19,代码来源:GUITools.cpp

示例6: GetPluginInfoW

void WINAPI GetPluginInfoW(PluginInfo* info) {
  info->StructSize = sizeof(PluginInfo);

  ObjectArray<DeviceInfo> dev_list;
  try {
    init_if_needed();
    get_device_list(dev_list);
  }
  catch (...) {
    dev_list.clear();
  }
  if (dev_list.size() == 0) {
    if (g_plugin_options.last_dev_type == dtPDA) disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_PDA);
    else if (g_plugin_options.last_dev_type == dtSmartPhone) disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_SMARTPHONE);
    else disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_PDA);
  }
  else {
    if (dev_list[0].platform == L"PocketPC") {
      disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_PDA);
      g_plugin_options.last_dev_type = dtPDA;
    }
    else if (dev_list[0].platform == L"SmartPhone") {
      disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_SMARTPHONE);
      g_plugin_options.last_dev_type = dtSmartPhone;
    }
    else {
      disk_menu[0] = far_msg_ptr(MSG_DISK_MENU_PDA);
      g_plugin_options.last_dev_type = dtPDA;
    }
    save_plugin_options(g_plugin_options);
  }

  if (g_plugin_options.add_to_disk_menu) {
    info->DiskMenu.Strings = disk_menu;
    info->DiskMenu.Guids = &c_disk_menu_guid;
    info->DiskMenu.Count = ARRAYSIZE(disk_menu);
  }

  if (g_plugin_options.add_to_plugin_menu) {
    plugin_menu[0] = far_msg_ptr(MSG_PLUGIN_NAME);
    info->PluginMenu.Strings = plugin_menu;
    info->PluginMenu.Guids = &c_plugin_menu_guid;
    info->PluginMenu.Count = ARRAYSIZE(plugin_menu);
  }

  config_menu[0] = far_msg_ptr(MSG_PLUGIN_NAME);
  info->PluginConfig.Strings = config_menu;
  info->PluginConfig.Guids = &c_config_menu_guid;
  info->PluginConfig.Count = ARRAYSIZE(config_menu);

  info->CommandPrefix = g_plugin_format.data();
}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:52,代码来源:plugin.cpp

示例7: ExecuteShellAndWait

bool ExecuteShellAndWait(HINSTANCE /*Handle*/, const UnicodeString & APath,
  const UnicodeString & Params, TProcessMessagesEvent ProcessMessages)
{
  TShellExecuteInfoW ExecuteInfo;
  ::ZeroMemory(&ExecuteInfo, sizeof(ExecuteInfo));
  ExecuteInfo.cbSize = sizeof(ExecuteInfo);
  ExecuteInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
  ExecuteInfo.hwnd = reinterpret_cast<HWND>(::GetModuleHandle(0));
  ExecuteInfo.lpFile = const_cast<wchar_t *>(APath.data());
  ExecuteInfo.lpParameters = const_cast<wchar_t *>(Params.data());
  ExecuteInfo.nShow = SW_SHOW;

  bool Result = (::ShellExecuteEx(&ExecuteInfo) != 0);
  if (Result)
  {
    if (ProcessMessages != nullptr)
    {
      uint32_t WaitResult;
      do
      {
        WaitResult = ::WaitForSingleObject(ExecuteInfo.hProcess, 200);
        if (WaitResult == WAIT_FAILED)
        {
          throw Exception(LoadStr(DOCUMENT_WAIT_ERROR));
        }
        ProcessMessages();
      }
      while (WaitResult == WAIT_TIMEOUT);
    }
    else
    {
      ::WaitForSingleObject(ExecuteInfo.hProcess, INFINITE);
    }
  }
  return Result;
}
开发者ID:gumb0,项目名称:Far-NetBox,代码行数:36,代码来源:GUITools.cpp

示例8: GetOpenPanelInfoW

void WINAPI GetOpenPanelInfoW(OpenPanelInfo* info) {
  PluginInstance* plugin = (PluginInstance*) info->hPanel;

  info->StructSize = sizeof(OpenPanelInfo);

  info->Flags = OPIF_ADDDOTS | OPIF_SHORTCUT;
  info->CurDir = plugin->current_dir.data();
  info->Format = g_plugin_format.data();

  if (g_plugin_options.last_dev_type == dtPDA) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  else if (g_plugin_options.last_dev_type == dtSmartPhone) plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_SMARTPHONE);
  else plugin->panel_title = far_msg_ptr(MSG_DISK_MENU_PDA);
  plugin->panel_title.add(L":").add(plugin->current_dir);

  if (g_plugin_options.show_free_space) plugin->panel_title.add(L":" + format_data_size(plugin->free_space, get_size_suffixes()));
  info->PanelTitle = plugin->panel_title.data();
  info->InfoLines = plugin->sys_info.data();
  info->InfoLinesNumber = plugin->sys_info.size();
}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:19,代码来源:plugin.cpp

示例9: unicode_to_oem

// unicode <-> oem codepage conversions
void unicode_to_oem(AnsiString& oem_str, const UnicodeString& u_str) {
  unsigned size = u_str.size() + 1;
  int res = WideCharToMultiByte(CP_OEMCP, 0, u_str.data(), size, oem_str.buf(u_str.size()), size, NULL, NULL);
  if (res == 0) FAIL(SystemError());
  oem_str.set_size(res - 1);
}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:7,代码来源:util.cpp


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