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


C++ UString::Delete方法代码示例

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


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

示例1: SetProperty

HRESULT CMultiMethodProps::SetProperty(const wchar_t *nameSpec, const PROPVARIANT &value)
{
  UString name = nameSpec;
  name.MakeLower_Ascii();
  if (name.IsEmpty())
    return E_INVALIDARG;
  
  if (name[0] == 'x')
  {
    name.Delete(0);
    _level = 9;
    return ParsePropToUInt32(name, value, _level);
  }

  if (name.IsPrefixedBy_Ascii_NoCase("yx"))
  {
    name.Delete(0, 2);
    UInt32 v = 9;
    RINOK(ParsePropToUInt32(name, value, v));
    _analysisLevel = (int)v;
    return S_OK;
  }
  
  if (name.IsEqualTo("crc"))
  {
    name.Delete(0, 3);
    _crcSize = 4;
    return ParsePropToUInt32(name, value, _crcSize);
  }
  
  UInt32 number;
  unsigned index = ParseStringToUInt32(name, number);
  UString realName = name.Ptr(index);
  if (index == 0)
  {
    if (name.IsPrefixedBy_Ascii_NoCase("mt"))
    {
      #ifndef _7ZIP_ST
      RINOK(ParseMtProp(name.Ptr(2), value, _numProcessors, _numThreads));
      #endif
      
      return S_OK;
    }
    if (name.IsEqualTo("f"))
    {
      HRESULT res = PROPVARIANT_to_bool(value, _autoFilter);
      if (res == S_OK)
        return res;
      if (value.vt != VT_BSTR)
        return E_INVALIDARG;
      return _filterMethod.ParseMethodFromPROPVARIANT(UString(), value);
    }
    number = 0;
  }
  if (number > 64)
    return E_FAIL;
  for (int j = _methods.Size(); j <= (int)number; j++)
    _methods.Add(COneMethodInfo());
  return _methods[number].ParseMethodFromPROPVARIANT(realName, value);
}
开发者ID:ming-hai,项目名称:soui,代码行数:60,代码来源:HandlerOut.cpp

示例2: ResolveDotsFolders

static bool ResolveDotsFolders(UString &s)
{
  #ifdef _WIN32
  s.Replace(L'/', WCHAR_PATH_SEPARATOR);
  #endif
  for (int i = 0;;)
  {
    wchar_t c = s[i];
    if (c == 0)
      return true;
    if (c == '.' && (i == 0 || s[i - 1] == WCHAR_PATH_SEPARATOR))
    {
      wchar_t c1 = s[i + 1];
      if (c1 == '.')
      {
        wchar_t c2 = s[i + 2];
        if (c2 == WCHAR_PATH_SEPARATOR || c2 == 0)
        {
          if (i == 0)
            return false;
          int k = i - 2;
          for (; k >= 0; k--)
            if (s[k] == WCHAR_PATH_SEPARATOR)
              break;
          unsigned num;
          if (k >= 0)
          {
            num = i + 2 - k;
            i = k;
          }
          else
          {
            num = (c2 == 0 ? (i + 2) : (i + 3));
            i = 0;
          }
          s.Delete(i, num);
          continue;
        }
      }
      else
      {
        if (c1 == WCHAR_PATH_SEPARATOR || c1 == 0)
        {
          unsigned num = 2;
          if (i != 0)
            i--;
          else if (c1 == 0)
            num = 1;
          s.Delete(i, num);
          continue;
        }
      }
    }
    i++;
  }
}
开发者ID:ArchangelSDY,项目名称:Qt7z,代码行数:56,代码来源:FileName.cpp

示例3: SetProperties

STDMETHODIMP CHandler::SetProperties(const wchar_t **names, const PROPVARIANT *values, Int32 numProperties)
{
  COM_TRY_BEGIN
  _binds.Clear();
  BeforeSetProperty();

  for (int i = 0; i < numProperties; i++)
  {
    UString name = names[i];
    name.MakeUpper();
    if (name.IsEmpty())
      return E_INVALIDARG;

    const PROPVARIANT &value = values[i];

    if (name[0] == 'B')
    {
      name.Delete(0);
      CBind bind;
      RINOK(GetBindInfo(name, bind));
      _binds.Add(bind);
      continue;
    }

    RINOK(SetProperty(name, value));
  }

  return S_OK;
  COM_TRY_END
}
开发者ID:1024jp,项目名称:CleanArchiver,代码行数:30,代码来源:7zHandlerOut.cpp

示例4: LoadFullPathAndShow

void CPanel::LoadFullPathAndShow()
{
    LoadFullPath();
    _appState->FolderHistory.AddString(_currentFolderPrefix);

    _headerComboBox.SetText(_currentFolderPrefix);
#ifdef _WIN32 // FIXME
    COMBOBOXEXITEM item;
    item.mask = 0;

    UString path = _currentFolderPrefix;
    if (path.Length() > 3 && path[path.Length() - 1] == WCHAR_PATH_SEPARATOR)
        path.Delete(path.Length() - 1);

    CFileInfoW info;
    DWORD attrib = FILE_ATTRIBUTE_DIRECTORY;
    if (NFile::NFind::FindFile(path, info))
        attrib = info.Attrib;

    item.iImage = GetRealIconIndex(path, attrib);

    if (item.iImage >= 0)
    {
        item.iSelectedImage = item.iImage;
        item.mask |= (CBEIF_IMAGE | CBEIF_SELECTEDIMAGE);
    }
    item.iItem = -1;
    _headerComboBox.SetItem(&item);
#endif

    RefreshTitle();
}
开发者ID:bluekylin,项目名称:nds4ios,代码行数:32,代码来源:PanelFolderChange.cpp

示例5: GetCorrectPath

UString GetCorrectPath(const UString &path)
{
  UString result = path;
  int first;
  for (first = 0; first < result.Length(); first++)
    if (result[first] != ' ')
      break;
  while(result.Length() > first)
  {
    if (
      #ifdef _WIN32
      result[first] == L'\\' || 
      #endif
      result[first] == L'/')
    {
      result.Delete(first);
      continue;
    }
    break;
  }
  #ifdef _WIN32
  result.Replace(L"..\\", L"");
  #endif
  result.Replace(L"../", L"");

  ReplaceDisk(result);
  return result;
}
开发者ID:BGCX261,项目名称:zipeg-svn-to-git,代码行数:28,代码来源:ExtractingFilePath.cpp

示例6: OpenParentFolder

void CPanel::OpenParentFolder()
{
    printf("CPanel::OpenParentFolder\n");
    LoadFullPath(); // Maybe we don't need it ??
    UString focucedName;
    if (!_currentFolderPrefix.IsEmpty())
    {
        UString string = _currentFolderPrefix;
        string.Delete(string.Length() - 1);
        int pos = string.ReverseFind(WCHAR_PATH_SEPARATOR);
        if (pos < 0)
            pos = 0;
        else
            pos++;
        focucedName = string.Mid(pos);
    }

    printf("CPanel::OpenParentFolder focucedName=%ls\n",(const wchar_t *)focucedName);

    CDisableTimerProcessing disableTimerProcessing1(*this);
    CMyComPtr<IFolderFolder> newFolder;
    _folder->BindToParentFolder(&newFolder);
    if (newFolder)
        _folder = newFolder;
    else
    {
        if (_parentFolders.IsEmpty())
        {
            SetToRootFolder();
            if (focucedName.IsEmpty())
                focucedName = GetItemName(0);
        }
        else
        {
            _folder.Release();
            _library.Free();
            CFolderLink &link = _parentFolders.Back();
            _folder = link.ParentFolder;
            _library.Attach(link.Library.Detach());
            focucedName = link.ItemName;
            if (_parentFolders.Size () > 1)
                OpenParentArchiveFolder();
            _parentFolders.DeleteBack();
        }
    }

    UStringVector selectedItems;
    /*
    if (!focucedName.IsEmpty())
      selectedItems.Add(focucedName);
    */
    LoadFullPath();
    // ::SetCurrentDirectory(::_currentFolderPrefix);
    RefreshListCtrl(focucedName, -1, true, selectedItems);
    _listView.EnsureVisible(_listView.GetFocusedItem(), false);
    RefreshStatusBar();

    printf("CPanel::OpenParentFolder-end\n");
}
开发者ID:bluekylin,项目名称:nds4ios,代码行数:59,代码来源:PanelFolderChange.cpp

示例7: ReduceString

static void ReduceString(UString &s)
{
  const unsigned kMaxSize = 64;
  if (s.Len() <= kMaxSize)
    return;
  s.Delete(kMaxSize / 2, s.Len() - kMaxSize);
  s.Insert(kMaxSize / 2, L" ... ");
}
开发者ID:endlessm,项目名称:rufus,代码行数:8,代码来源:ContextMenu.cpp

示例8: GetBindInfoPart

static HRESULT GetBindInfoPart(UString &srcString, UInt32 &coder, UInt32 &stream)
{
  stream = 0;
  int index = ParseStringToUInt32(srcString, coder);
  if (index == 0)
    return E_INVALIDARG;
  srcString.Delete(0, index);
  if (srcString[0] == 'S')
  {
    srcString.Delete(0);
    int index = ParseStringToUInt32(srcString, stream);
    if (index == 0)
      return E_INVALIDARG;
    srcString.Delete(0, index);
  }
  return S_OK;
}
开发者ID:1024jp,项目名称:CleanArchiver,代码行数:17,代码来源:7zHandlerOut.cpp

示例9: GetOSName2

UString GetOSName2(const UString &name)
{
  if (name.IsEmpty())
    return UString();
  UString newName = GetOSName(name);
  if (newName[newName.Length() - 1] == kOSDirDelimiter)
    newName.Delete(newName.Length() - 1);
  return newName;
}
开发者ID:4ft35t,项目名称:firmware-mod-kit,代码行数:9,代码来源:ItemNameUtils.cpp

示例10: AddName

static void AddName(UStringVector &strings, UString &s)
{
  s.Trim();
  if (s.Len() >= 2 && s[0] == kQuoteChar && s.Back() == kQuoteChar)
  {
    s.DeleteBack();
    s.Delete(0);
  }
  if (!s.IsEmpty())
    strings.Add(s);
}
开发者ID:MIPS,项目名称:external-lzma,代码行数:11,代码来源:ListFileUtils.cpp

示例11: GetBindInfo

static HRESULT GetBindInfo(UString &srcString, CBind &bind)
{
  RINOK(GetBindInfoPart(srcString, bind.OutCoder, bind.OutStream));
  if (srcString[0] != ':')
    return E_INVALIDARG;
  srcString.Delete(0);
  RINOK(GetBindInfoPart(srcString, bind.InCoder, bind.InStream));
  if (!srcString.IsEmpty())
    return E_INVALIDARG;
  return S_OK;
}
开发者ID:1024jp,项目名称:CleanArchiver,代码行数:11,代码来源:7zHandlerOut.cpp

示例12: StripFile

// Strip the file name from the full path, keeping the trailing /
void StripFile(UString& path) 
{
	// remove file name
	int last = path.ReverseFind(L'/');
	if (last != -1) {
		int namelen = path.Length() - last;
		path.Delete(last + 1, namelen - 1);
	} else {// file not directory
		path.Empty();
	}
}
开发者ID:ColdDaemon,项目名称:p7zip_explode,代码行数:12,代码来源:Explode.cpp

示例13: ShowErrorMessageSpec

static void ShowErrorMessageSpec(const UString &name)
{
  UString message = NError::MyFormatMessage(::GetLastError());
  int pos = message.Find(L"%1");
  if (pos >= 0)
  {
    message.Delete(pos, 2);
    message.Insert(pos, name);
  }
  ShowErrorMessage(NULL, message);
}
开发者ID:Dagarman,项目名称:mame,代码行数:11,代码来源:SfxSetup.cpp

示例14: AddMessage

void CMessagesDialog::AddMessage(LPCWSTR message)
{
  UString s = message;
  while (!s.IsEmpty())
  {
    int pos = s.Find(L'\n');
    if (pos < 0)
      break;
    AddMessageDirect(s.Left(pos));
    s.Delete(0, pos + 1);
  }
  AddMessageDirect(s);
}
开发者ID:walrus8u,项目名称:extract,代码行数:13,代码来源:MessagesDialog.cpp

示例15: ReplaceDisk

static void ReplaceDisk(UString &s)
{
  int i;
  for (i = 0; i < s.Length(); i++)
    if (s[i] != ' ')
      break;
  if (s.Length() > i + 1)
  {
    if (s[i + 1] == L':')
    {
      s.Delete(i + 1);
      // s.Insert(i + 1, L'_');
    }
  }
}
开发者ID:BGCX261,项目名称:zipeg-svn-to-git,代码行数:15,代码来源:ExtractingFilePath.cpp


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