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


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

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


在下文中一共展示了CFX_WideString::c_str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: mailForm

FX_BOOL Document::mailForm(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
	ASSERT(m_pDocument != NULL);

	if (!m_pDocument->GetPermissions(FPDFPERM_EXTRACT_ACCESS)) return FALSE;

	int iLength = params.size();

	FX_BOOL bUI = iLength > 0 ? params[0].ToBool() : TRUE;
	CFX_WideString cTo = iLength > 1 ? params[1].ToCFXWideString() : L"";
	CFX_WideString cCc = iLength > 2 ? params[2].ToCFXWideString() : L"";
	CFX_WideString cBcc = iLength > 3 ? params[3].ToCFXWideString() : L"";
	CFX_WideString cSubject = iLength > 4 ? params[4].ToCFXWideString() : L"";
	CFX_WideString cMsg = iLength > 5 ? params[5].ToCFXWideString() : L"";

	CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)m_pDocument->GetInterForm();
	ASSERT(pInterForm != NULL);

	CFX_ByteTextBuf textBuf;
	if (!pInterForm->ExportFormToFDFTextBuf(textBuf))
		return FALSE;

	CJS_Context* pContext = (CJS_Context*)cc;
	ASSERT(pContext != NULL);
	CPDFDoc_Environment* pEnv = pContext->GetReaderApp();
	ASSERT(pEnv != NULL);
	CJS_Runtime* pRuntime = pContext->GetJSRuntime();
	ASSERT(pRuntime != NULL);

	pRuntime->BeginBlock();
	pEnv->JS_docmailForm(textBuf.GetBuffer(), textBuf.GetLength(), bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
	pRuntime->EndBlock();
	return TRUE;
}
开发者ID:mcanthony,项目名称:libpdf,代码行数:34,代码来源:Document.cpp

示例3: PutRequestURL

FX_BOOL CPDFXFA_App::PutRequestURL(const CFX_WideString& wsURL,
                                   const CFX_WideString& wsData,
                                   const CFX_WideString& wsEncode) {
    CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
    return pEnv &&
           pEnv->FFI_PutRequestURL(wsURL.c_str(), wsData.c_str(),
                                   wsEncode.c_str());
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:8,代码来源:fpdfxfa_app.cpp

示例4: DoJob

FX_BOOL CJS_Context::DoJob(int nMode, const CFX_WideString& script, CFX_WideString& info)
{
	if (m_bBusy)
	{
		info = JSGetStringFromID(this, IDS_STRING_JSBUSY);
		return FALSE;
	}

	m_bBusy = TRUE;

	ASSERT(m_pRuntime != NULL);
	ASSERT(m_pEventHandler != NULL);
	ASSERT(m_pEventHandler->IsValid());

	if (!m_pRuntime->AddEventToLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType()))
	{
		info = JSGetStringFromID(this, IDS_STRING_JSEVENT);
		return FALSE;
	}

	FXJSErr error ={NULL,NULL, 0};
	int nRet = 0;

	if (script.GetLength() > 0)
	{
		if (nMode == 0)
		{
			nRet = JS_Execute(*m_pRuntime, this, script.c_str(), script.GetLength(), &error);
		}
		else
		{
			nRet = JS_Parse(*m_pRuntime, this, script.c_str(), script.GetLength(), &error);
		}
	}

	if (nRet < 0)
	{
		CFX_WideString sLine;
		sLine.Format(L"[ Line: %05d { %s } ] : %s",error.linnum-1,error.srcline,error.message);

//			TRACE(L"/* -------------- JS Error -------------- */\n");
//			TRACE(sLine);
//			TRACE(L"\n");
		//CFX_ByteString sTemp = CFX_ByteString::FromUnicode(error.message);
		info += sLine;
	}
	else
	{
		info = JSGetStringFromID(this, IDS_STRING_RUN);
	}

	m_pRuntime->RemoveEventInLoop(m_pEventHandler->TargetName(), m_pEventHandler->EventType());

	m_pEventHandler->Destroy();
	m_bBusy = FALSE;

	return nRet >= 0;
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:58,代码来源:JS_Context.cpp

示例5: MsgBox

int32_t CPDFXFA_App::MsgBox(const CFX_WideString& wsMessage,
                            const CFX_WideString& wsTitle,
                            uint32_t dwIconType,
                            uint32_t dwButtonType) {
    CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
    if (!pEnv)
        return -1;

    uint32_t iconType = 0;
    int iButtonType = 0;
    switch (dwIconType) {
    case XFA_MBICON_Error:
        iconType |= 0;
        break;
    case XFA_MBICON_Warning:
        iconType |= 1;
        break;
    case XFA_MBICON_Question:
        iconType |= 2;
        break;
    case XFA_MBICON_Status:
        iconType |= 3;
        break;
    }
    switch (dwButtonType) {
    case XFA_MB_OK:
        iButtonType |= 0;
        break;
    case XFA_MB_OKCancel:
        iButtonType |= 1;
        break;
    case XFA_MB_YesNo:
        iButtonType |= 2;
        break;
    case XFA_MB_YesNoCancel:
        iButtonType |= 3;
        break;
    }
    int32_t iRet = pEnv->JS_appAlert(wsMessage.c_str(), wsTitle.c_str(),
                                     iButtonType, iconType);
    switch (iRet) {
    case 1:
        return XFA_IDOK;
    case 2:
        return XFA_IDCancel;
    case 3:
        return XFA_IDNo;
    case 4:
        return XFA_IDYes;
    }
    return XFA_IDYes;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:52,代码来源:fpdfxfa_app.cpp

示例6: PostRequestURL

FX_BOOL CPDFXFA_App::PostRequestURL(const CFX_WideString& wsURL,
                                    const CFX_WideString& wsData,
                                    const CFX_WideString& wsContentType,
                                    const CFX_WideString& wsEncode,
                                    const CFX_WideString& wsHeader,
                                    CFX_WideString& wsResponse) {
    CPDFDoc_Environment* pEnv = m_pEnvList.GetAt(0);
    if (!pEnv)
        return FALSE;

    wsResponse = pEnv->FFI_PostRequestURL(wsURL.c_str(), wsData.c_str(),
                                          wsContentType.c_str(), wsEncode.c_str(),
                                          wsHeader.c_str());
    return TRUE;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:15,代码来源:fpdfxfa_app.cpp

示例7: OnFormat

void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
                                CPDFSDK_PageView* pPageView,
                                FX_BOOL& bExit,
                                FX_DWORD nFlag) {
    if (!m_bNotifying) {
        ASSERT(pWidget != NULL);
        ASSERT(pPageView != NULL);
        //      CReader_DocView* pDocView = pPageView->GetDocView();
        //      ASSERT(pDocView != NULL);
        CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
        ASSERT(pDocument != NULL);

        CPDFSDK_InterForm* pInterForm =
            (CPDFSDK_InterForm*)pDocument->GetInterForm();
        ASSERT(pInterForm != NULL);

        FX_BOOL bFormated = FALSE;
        CFX_WideString sValue =
            pInterForm->OnFormat(pWidget->GetFormField(), bFormated);

        //      bExit = !IsValidAnnot(m_pApp, pDocument, pDocView, pPageView,
        //      pWidget);

        if (bExit)
            return;

        if (bFormated) {
            pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(),
                                             TRUE);
            pInterForm->UpdateField(pWidget->GetFormField());
        }

        m_bNotifying = FALSE;
    }
}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:35,代码来源:FFL_IFormFiller.cpp

示例8: OnFormat

void CFFL_IFormFiller::OnFormat(CPDFSDK_Widget* pWidget,
                                CPDFSDK_PageView* pPageView,
                                FX_BOOL& bExit,
                                uint32_t nFlag) {
  if (!m_bNotifying) {
    ASSERT(pWidget);
    CPDFSDK_Document* pDocument = pPageView->GetSDKDocument();
    CPDFSDK_InterForm* pInterForm = pDocument->GetInterForm();

    FX_BOOL bFormated = FALSE;
    CFX_WideString sValue =
        pInterForm->OnFormat(pWidget->GetFormField(), bFormated);

    if (bExit)
      return;

    if (bFormated) {
      pInterForm->ResetFieldAppearance(pWidget->GetFormField(), sValue.c_str(),
                                       TRUE);
      pInterForm->UpdateField(pWidget->GetFormField());
    }

    m_bNotifying = FALSE;
  }
}
开发者ID:gradescope,项目名称:pdfium,代码行数:25,代码来源:cffl_iformfiller.cpp

示例9: IsFitArea

FX_BOOL CFDE_TxtEdtEngine::IsFitArea(CFX_WideString& wsText) {
  std::unique_ptr<CFDE_TextOut> pTextOut(new CFDE_TextOut);
  pTextOut->SetLineSpace(m_Param.fLineSpace);
  pTextOut->SetFont(m_Param.pFont);
  pTextOut->SetFontSize(m_Param.fFontSize);
  CFX_RectF rcText;
  FXSYS_memset(&rcText, 0, sizeof(rcText));
  uint32_t dwStyle = 0;
  if (!(m_Param.dwMode & FDE_TEXTEDITMODE_MultiLines))
    dwStyle |= FDE_TTOSTYLE_SingleLine;

  if (m_Param.dwMode & FDE_TEXTEDITMODE_AutoLineWrap) {
    dwStyle |= FDE_TTOSTYLE_LineWrap;
    rcText.width = m_Param.fPlateWidth;
  } else {
    rcText.width = 65535;
  }
  pTextOut->SetStyles(dwStyle);
  wsText += L"\n";
  pTextOut->CalcLogicSize(wsText.c_str(), wsText.GetLength(), rcText);
  wsText.Delete(wsText.GetLength() - 1);
  if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Horz) &&
      (rcText.width > m_Param.fPlateWidth)) {
    return FALSE;
  }
  if ((m_Param.dwMode & FDE_TEXTEDITMODE_LimitArea_Vert) &&
      (rcText.height > m_Param.fLineSpace * m_Param.nLineCount)) {
    return FALSE;
  }
  return TRUE;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:31,代码来源:cfde_txtedtengine.cpp

示例10: InsertOption

int CPDF_FormField::InsertOption(CFX_WideString csOptLabel,
                                 int index,
                                 FX_BOOL bNotify) {
  if (csOptLabel.IsEmpty())
    return -1;

  if (bNotify && !NotifyListOrComboBoxBeforeChange(csOptLabel))
    return -1;

  CFX_ByteString csStr =
      PDF_EncodeText(csOptLabel.c_str(), csOptLabel.GetLength());
  CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");
  CPDF_Array* pOpt = ToArray(pValue);
  if (!pOpt) {
    pOpt = new CPDF_Array;
    m_pDict->SetAt("Opt", pOpt);
  }

  int iCount = (int)pOpt->GetCount();
  if (index < 0 || index >= iCount) {
    pOpt->AddString(csStr);
    index = iCount;
  } else {
    CPDF_String* pString = new CPDF_String(csStr, FALSE);
    pOpt->InsertAt(index, pString);
  }

  if (bNotify)
    NotifyListOrComboBoxAfterChange();
  return index;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:31,代码来源:doc_formfield.cpp

示例11: SubmitForm

FX_BOOL CPDFSDK_InterForm::SubmitForm(const CFX_WideString& sDestination,
                                      FX_BOOL bUrlEncoded) {
  if (sDestination.IsEmpty())
    return FALSE;

  if (!m_pDocument || !m_pInterForm)
    return FALSE;

  CPDFSDK_Environment* pEnv = m_pDocument->GetEnv();
  CFX_WideString wsPDFFilePath = m_pDocument->GetPath();
  CFDF_Document* pFDFDoc =
      m_pInterForm->ExportToFDF(wsPDFFilePath.AsStringC(), false);
  if (!pFDFDoc)
    return FALSE;

  CFX_ByteTextBuf FdfBuffer;
  FX_BOOL bRet = pFDFDoc->WriteBuf(FdfBuffer);
  delete pFDFDoc;
  if (!bRet)
    return FALSE;

  uint8_t* pBuffer = FdfBuffer.GetBuffer();
  FX_STRSIZE nBufSize = FdfBuffer.GetLength();

  if (bUrlEncoded && !FDFToURLEncodedData(pBuffer, nBufSize))
    return FALSE;

  pEnv->JS_docSubmitForm(pBuffer, nBufSize, sDestination.c_str());

  if (bUrlEncoded)
    FX_Free(pBuffer);

  return TRUE;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:34,代码来源:cpdfsdk_interform.cpp

示例12: SetText

void CFDE_TxtEdtBuf::SetText(const CFX_WideString& wsText) {
  ASSERT(!wsText.IsEmpty());
  Clear(FALSE);
  int32_t nTextLength = wsText.GetLength();
  int32_t nNeedCount =
      ((nTextLength - 1) / m_nChunkSize + 1) - m_Chunks.GetSize();
  int32_t i = 0;
  for (i = 0; i < nNeedCount; i++) {
    FDE_CHUNKHEADER* lpChunk =
        static_cast<FDE_CHUNKHEADER*>(m_pAllocator->Alloc(
            sizeof(FDE_CHUNKHEADER) + (m_nChunkSize - 1) * sizeof(FX_WCHAR)));
    lpChunk->nUsed = 0;
    m_Chunks.Add(lpChunk);
  }
  int32_t nTotalCount = m_Chunks.GetSize();
  const FX_WCHAR* lpSrcBuf = wsText.c_str();
  int32_t nLeave = nTextLength;
  int32_t nCopyedLength = m_nChunkSize;
  for (i = 0; i < nTotalCount && nLeave > 0; i++) {
    if (nLeave < nCopyedLength) {
      nCopyedLength = nLeave;
    }
    FDE_CHUNKHEADER* lpChunk = m_Chunks[i];
    FXSYS_memcpy(lpChunk->wChars, lpSrcBuf, nCopyedLength * sizeof(FX_WCHAR));
    nLeave -= nCopyedLength;
    lpSrcBuf += nCopyedLength;
    lpChunk->nUsed = nCopyedLength;
  }
  m_nTotal = nTextLength;
  m_bChanged = TRUE;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:31,代码来源:cfde_txtedtbuf.cpp

示例13: PasteText

void CPWL_Edit::PasteText() {
  if (!CanPaste())
    return;

  CFX_WideString swClipboard;
  if (IFX_SystemHandler* pSH = GetSystemHandler())
    swClipboard = pSH->GetClipboardText(GetAttachedHWnd());

  if (m_pFillerNotify) {
    FX_BOOL bRC = TRUE;
    FX_BOOL bExit = FALSE;
    CFX_WideString strChangeEx;
    int nSelStart = 0;
    int nSelEnd = 0;
    GetSel(nSelStart, nSelEnd);
    m_pFillerNotify->OnBeforeKeyStroke(GetAttachedData(), swClipboard,
                                       strChangeEx, nSelStart, nSelEnd, TRUE,
                                       bRC, bExit, 0);
    if (!bRC)
      return;
    if (bExit)
      return;
  }

  if (swClipboard.GetLength() > 0) {
    Clear();
    InsertText(swClipboard.c_str());
  }
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:29,代码来源:PWL_Edit.cpp

示例14: NewPDFWindow

CPWL_Wnd* CFFL_TextField::NewPDFWindow(const PWL_CREATEPARAM& cp, CPDFSDK_PageView* pPageView)
{
    CPWL_Edit * pWnd = new CPWL_Edit();
        pWnd->AttachFFLData(this);
    pWnd->Create(cp);



    ASSERT(m_pApp != NULL);
    CFFL_IFormFiller* pIFormFiller = m_pApp->GetIFormFiller();
    pWnd->SetFillerNotify(pIFormFiller);

    ASSERT(m_pWidget != NULL);
    int32_t nMaxLen = m_pWidget->GetMaxLen();
    CFX_WideString swValue = m_pWidget->GetValue();

    if (nMaxLen > 0)
    {
        if (pWnd->HasFlag(PES_CHARARRAY))
        {
            pWnd->SetCharArray(nMaxLen);
            pWnd->SetAlignFormatV(PEAV_CENTER);
        }
        else
        {
            pWnd->SetLimitChar(nMaxLen);
        }
    }

    pWnd->SetText(swValue.c_str());
    return pWnd;
}
开发者ID:abbro-ca,项目名称:pdfium,代码行数:32,代码来源:FFL_TextField.cpp

示例15: OnLoad

void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) {
  if (pAnnot->GetSubType() == BFFT_SIGNATURE)
    return;

  CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pAnnot;
  if (!pWidget->IsAppearanceValid())
    pWidget->ResetAppearance(NULL, FALSE);

  int nFieldType = pWidget->GetFieldType();
  if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) {
    FX_BOOL bFormated = FALSE;
    CFX_WideString sValue = pWidget->OnFormat(bFormated);
    if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) {
      pWidget->ResetAppearance(sValue.c_str(), FALSE);
    }
  }

#ifdef PDF_ENABLE_XFA
  CPDFSDK_PageView* pPageView = pAnnot->GetPageView();
  CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument();
  CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument();
  if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) {
    if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty())
      pWidget->ResetAppearance(FALSE);
  }
#endif  // PDF_ENABLE_XFA
  if (m_pFormFiller)
    m_pFormFiller->OnLoad(pAnnot);
}
开发者ID:andoma,项目名称:pdfium,代码行数:29,代码来源:fsdk_annothandler.cpp


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