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


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

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


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

示例1: DelimitFileNameMask

//---------------------------------------------------------------------------
UnicodeString DelimitFileNameMask(const UnicodeString & Mask)
{
  UnicodeString Result = Mask;
  for (intptr_t I = 1; I <= Result.Length(); I++)
  {
    if (wcschr(L"\\*?", Result[I]) != nullptr)
    {
      Result.Insert(L"\\", I);
      I++;
    }
  }
  return Result;
}
开发者ID:nineclock,项目名称:Far-NetBox,代码行数:14,代码来源:FileMasks.cpp

示例2: IntToHex

//---------------------------------------------------------------------------
UnicodeString IntToHex(uintptr_t Int, uintptr_t MinChars)
{
  UnicodeString Result;
  Result.sprintf(L"%X", Int);
  intptr_t Pad = MinChars - Result.Length();
  if (Pad > 0)
  {
    for (intptr_t I = 0; I < Pad; I++)
    {
      Result.Insert(L'0', 1);
    }
  }
  return Result;
}
开发者ID:CyberShadow,项目名称:Far-NetBox,代码行数:15,代码来源:Sysutils.cpp

示例3: ComposeMaskStr

//---------------------------------------------------------------------------
UnicodeString TFileMasks::ComposeMaskStr(
  TStrings * MasksStr, bool Directory)
{
  UnicodeString Result;
  UnicodeString ResultNoDirMask;
  for (intptr_t I = 0; I < MasksStr->GetCount(); ++I)
  {
    UnicodeString Str = MasksStr->GetString(I).Trim();
    if (!Str.IsEmpty())
    {
      for (intptr_t P = 1; P <= Str.Length(); P++)
      {
        if (Str.IsDelimiter(AllFileMasksDelimiters, P))
        {
          Str.Insert(Str[P], P);
          P++;
        }
      }

      UnicodeString StrNoDirMask;
      if (Directory)
      {
        StrNoDirMask = Str;
        Str = MakeDirectoryMask(Str);
      }
      else
      {
        while (Str.IsDelimiter(DirectoryMaskDelimiters, Str.Length()))
        {
          Str.SetLength(Str.Length() - 1);
        }
        StrNoDirMask = Str;
      }

      AddToList(Result, Str, FileMasksDelimiterStr);
      AddToList(ResultNoDirMask, StrNoDirMask, FileMasksDelimiterStr);
    }
  }

  // For directories, the above will add slash ay the end of masks,
  // breaking size and time masks and thus circumverting their validation.
  // This performes as hoc validation to cover the scenario.
  // For files this makes no difference, but no harm either
  TFileMasks Temp(Directory ? 1 : 0);
  Temp = ResultNoDirMask;

  return Result;
}
开发者ID:nineclock,项目名称:Far-NetBox,代码行数:49,代码来源:FileMasks.cpp

示例4: DoXmlEscape

static UnicodeString DoXmlEscape(const UnicodeString & Str, bool NewLine)
{
  UnicodeString Result = Str;
  for (intptr_t Index = 1; Index <= Result.Length(); ++Index)
  {
    const wchar_t * Repl = nullptr;
    switch (Result[Index])
    {
      case L'&':
        Repl = L"amp;";
        break;

      case L'>':
        Repl = L"gt;";
        break;

      case L'<':
        Repl = L"lt;";
        break;

      case L'"':
        Repl = L"quot;";
        break;

      case L'\n':
        if (NewLine)
        {
          Repl = L"#10;";
        }
        break;

      case L'\r':
        Result.Delete(Index, 1);
        Index--;
        break;
    }

    if (Repl != nullptr)
    {
      Result[Index] = L'&';
      Result.Insert(Repl, Index + 1);
      Index += wcslen(Repl);
    }
  }
  return Result;
}
开发者ID:gumb0,项目名称:Far-NetBox,代码行数:46,代码来源:SessionInfo.cpp

示例5: DoXmlEscape

static UnicodeString DoXmlEscape(UnicodeString AStr, bool NewLine)
{
  UnicodeString Str = AStr;
  for (intptr_t Index = 1; Index <= Str.Length(); ++Index)
  {
    const wchar_t *Repl = nullptr;
    switch (Str[Index])
    {
    case L'&':
      Repl = L"amp;";
      break;

    case L'>':
      Repl = L"gt;";
      break;

    case L'<':
      Repl = L"lt;";
      break;

    case L'"':
      Repl = L"quot;";
      break;

    case L'\n':
      if (NewLine)
      {
        Repl = L"#10;";
      }
      break;

    case L'\r':
      Str.Delete(Index, 1);
      --Index;
      break;
    }

    if (Repl != nullptr)
    {
      Str[Index] = L'&';
      Str.Insert(Repl, Index + 1);
      Index += nb::StrLength(Repl);
    }
  }
  return Str;
}
开发者ID:michaellukashov,项目名称:Far-NetBox,代码行数:46,代码来源:SessionInfo.cpp

示例6: DoXmlEscape

//---------------------------------------------------------------------------
UnicodeString __fastcall DoXmlEscape(UnicodeString Str, bool NewLine)
{
  for (int i = 1; i <= Str.Length(); i++)
  {
    const wchar_t * Repl = NULL;
    switch (Str[i])
    {
      case L'&':
        Repl = L"amp;";
        break;

      case L'>':
        Repl = L"gt;";
        break;

      case L'<':
        Repl = L"lt;";
        break;

      case L'"':
        Repl = L"quot;";
        break;

      case L'\n':
        if (NewLine)
        {
          Repl = L"#10;";
        }
        break;

      case L'\r':
        Str.Delete(i, 1);
        i--;
        break;
    }

    if (Repl != NULL)
    {
      Str[i] = L'&';
      Str.Insert(Repl, i + 1);
      i += wcslen(Repl);
    }
  }
  return Str;
}
开发者ID:seebigsea,项目名称:winscp,代码行数:46,代码来源:SessionInfo.cpp


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