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


C++ CFX_WideString::Replace方法代码示例

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


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

示例1: GetNameExpression

void CXFA_NodeHelper::GetNameExpression(CXFA_Node* refNode,
                                        CFX_WideString& wsName,
                                        FX_BOOL bIsAllPath,
                                        XFA_LOGIC_TYPE eLogicType) {
  wsName.clear();
  if (bIsAllPath) {
    GetNameExpression(refNode, wsName, FALSE, eLogicType);
    CFX_WideString wsParent;
    CXFA_Node* parent =
        ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
    while (parent) {
      GetNameExpression(parent, wsParent, FALSE, eLogicType);
      wsParent += L".";
      wsParent += wsName;
      wsName = wsParent;
      parent = ResolveNodes_GetParent(parent, XFA_LOGIC_NoTransparent);
    }
    return;
  }

  CFX_WideString ws;
  FX_BOOL bIsProperty = NodeIsProperty(refNode);
  if (refNode->IsUnnamed() ||
      (bIsProperty && refNode->GetElementType() != XFA_Element::PageSet)) {
    ws = refNode->GetClassName();
    wsName.Format(L"#%s[%d]", ws.c_str(),
                  GetIndex(refNode, eLogicType, bIsProperty, TRUE));
    return;
  }
  ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
  ws.Replace(L".", L"\\.");
  wsName.Format(L"%s[%d]", ws.c_str(),
                GetIndex(refNode, eLogicType, bIsProperty, FALSE));
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:34,代码来源:cxfa_nodehelper.cpp

示例2: XFA_GetNameExpression

void CXFA_NodeHelper::XFA_GetNameExpression(CXFA_Node* refNode,
                                            CFX_WideString& wsName,
                                            FX_BOOL bIsAllPath,
                                            XFA_LOGIC_TYPE eLogicType) {
  wsName.Empty();
  if (bIsAllPath) {
    XFA_GetNameExpression(refNode, wsName, FALSE, eLogicType);
    CFX_WideString wsParent;
    CXFA_Node* parent =
        XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
    while (parent != NULL) {
      XFA_GetNameExpression(parent, wsParent, FALSE, eLogicType);
      wsParent += L".";
      wsParent += wsName;
      wsName = wsParent;
      parent = XFA_ResolveNodes_GetParent(parent, XFA_LOGIC_NoTransparent);
    }
    return;
  } else {
    CFX_WideStringC wsTagName;
    CFX_WideString ws;
    FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode);
    if (refNode->IsUnnamed() ||
        (bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) {
      refNode->GetClassName(wsTagName);
      ws = wsTagName;
      wsName.Format(L"#%s[%d]", (const FX_WCHAR*)ws,
                    XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE));
      return;
    }
    ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
    ws.Replace(L".", L"\\.");
    wsName.Format(L"%s[%d]", (const FX_WCHAR*)ws,
                  XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE));
  }
}
开发者ID:andoma,项目名称:pdfium,代码行数:36,代码来源:xfa_script_nodehelper.cpp

示例3: ChangeObjName

CFX_WideString ChangeObjName(const CFX_WideString& str) {
  CFX_WideString sRet = str;
  sRet.Replace(L"_", L".");
  return sRet;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:5,代码来源:cjs_runtime.cpp

示例4: MailToInfo

bool CPDFXFA_DocEnvironment::MailToInfo(CFX_WideString& csURL,
                                        CFX_WideString& csToAddress,
                                        CFX_WideString& csCCAddress,
                                        CFX_WideString& csBCCAddress,
                                        CFX_WideString& csSubject,
                                        CFX_WideString& csMsg) {
  CFX_WideString srcURL = csURL;
  srcURL.TrimLeft();
  if (srcURL.Left(7).CompareNoCase(L"mailto:") != 0)
    return false;

  int pos = srcURL.Find(L'?', 0);
  CFX_WideString tmp;
  if (pos == -1) {
    pos = srcURL.Find(L'@', 0);
    if (pos == -1)
      return false;

    tmp = srcURL.Right(csURL.GetLength() - 7);
  } else {
    tmp = srcURL.Left(pos);
    tmp = tmp.Right(tmp.GetLength() - 7);
  }
  tmp.TrimLeft();
  tmp.TrimRight();

  csToAddress = tmp;

  srcURL = srcURL.Right(srcURL.GetLength() - (pos + 1));
  while (!srcURL.IsEmpty()) {
    srcURL.TrimLeft();
    srcURL.TrimRight();
    pos = srcURL.Find(L'&', 0);

    tmp = (pos == -1) ? srcURL : srcURL.Left(pos);
    tmp.TrimLeft();
    tmp.TrimRight();
    if (tmp.GetLength() >= 3 && tmp.Left(3).CompareNoCase(L"cc=") == 0) {
      tmp = tmp.Right(tmp.GetLength() - 3);
      if (!csCCAddress.IsEmpty())
        csCCAddress += L';';
      csCCAddress += tmp;
    } else if (tmp.GetLength() >= 4 &&
               tmp.Left(4).CompareNoCase(L"bcc=") == 0) {
      tmp = tmp.Right(tmp.GetLength() - 4);
      if (!csBCCAddress.IsEmpty())
        csBCCAddress += L';';
      csBCCAddress += tmp;
    } else if (tmp.GetLength() >= 8 &&
               tmp.Left(8).CompareNoCase(L"subject=") == 0) {
      tmp = tmp.Right(tmp.GetLength() - 8);
      csSubject += tmp;
    } else if (tmp.GetLength() >= 5 &&
               tmp.Left(5).CompareNoCase(L"body=") == 0) {
      tmp = tmp.Right(tmp.GetLength() - 5);
      csMsg += tmp;
    }
    srcURL = (pos == -1) ? L"" : srcURL.Right(csURL.GetLength() - (pos + 1));
  }
  csToAddress.Replace(L",", L";");
  csCCAddress.Replace(L",", L";");
  csBCCAddress.Replace(L",", L";");
  return true;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:64,代码来源:cpdfxfa_docenvironment.cpp


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