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


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

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


在下文中一共展示了CFX_WideString::Format方法的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: FormatDateString

void IFWL_DateTimePicker::FormatDateString(int32_t iYear,
                                           int32_t iMonth,
                                           int32_t iDay,
                                           CFX_WideString& wsText) {
  if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_ShortDateFormat) ==
      FWL_STYLEEXT_DTP_ShortDateFormat) {
    wsText.Format(L"%d-%d-%d", iYear, iMonth, iDay);
  } else if ((m_pProperties->m_dwStyleExes & FWL_STYLEEXT_DTP_LongDateFormat) ==
             FWL_STYLEEXT_DTP_LongDateFormat) {
    wsText.Format(L"%d Year %d Month %d Day", iYear, iMonth, iDay);
  }
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:12,代码来源:ifwl_datetimepicker.cpp

示例3: ShowNullTestMsg

void CXFA_FFDocView::ShowNullTestMsg() {
  int32_t iCount = m_arrNullTestMsg.GetSize();
  CXFA_FFApp* pApp = m_pDoc->GetApp();
  IXFA_AppProvider* pAppProvider = pApp->GetAppProvider();
  if (pAppProvider && iCount) {
    int32_t iRemain = iCount > 7 ? iCount - 7 : 0;
    iCount -= iRemain;
    CFX_WideString wsMsg;
    for (int32_t i = 0; i < iCount; i++) {
      wsMsg += m_arrNullTestMsg[i] + FX_WSTRC(L"\n");
    }
    if (iRemain > 0) {
      CFX_WideString wsLimit;
      pAppProvider->LoadString(XFA_IDS_ValidateLimit, wsLimit);
      if (!wsLimit.IsEmpty()) {
        CFX_WideString wsTemp;
        wsTemp.Format((const FX_WCHAR*)wsLimit, iRemain);
        wsMsg += FX_WSTRC(L"\n") + wsTemp;
      }
    }
    CFX_WideString wsTitle;
    pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
    pAppProvider->MsgBox(wsMsg, wsTitle, XFA_MBICON_Status, XFA_MB_OK);
  }
  m_arrNullTestMsg.RemoveAll();
}
开发者ID:andoma,项目名称:pdfium,代码行数:26,代码来源:xfa_ffdocview.cpp

示例4: ResetSubjectName

void CPWL_NoteItem::ResetSubjectName(FX_INT32 nItemIndex)
{
	if (nItemIndex < 0)
	{
		if (CPWL_Wnd* pParent = this->GetParentWindow())
		{
			ASSERT(pParent->GetClassName() == "CPWL_Note_Contents");

			CPWL_Note_Contents* pContents = (CPWL_Note_Contents*)pParent;
			nItemIndex = pContents->GetItemIndex(this);
		}
	}

	const CPWL_Note* pNote = GetNote();
	ASSERT(pNote != NULL);

	CFX_WideString sSubject;
	sSubject.Format(pNote->GetReplyString(), nItemIndex);

	if (!m_sAuthor.IsEmpty())
	{
		
		sSubject += L" - ";
		sSubject += m_sAuthor;
	}
	this->SetSubjectName(sSubject);
	this->RePosChildWnd();
}
开发者ID:HelloZhu,项目名称:PDFium.js,代码行数:28,代码来源:PWL_Note.cpp

示例5: SetColor

void CXFA_Fill::SetColor(FX_ARGB color) {
    CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Color);
    CFX_WideString wsColor;
    int a, r, g, b;
    ArgbDecode(color, a, r, g, b);
    wsColor.Format(L"%d,%d,%d", r, g, b);
    pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor);
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:8,代码来源:cxfa_fill.cpp

示例6: 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

示例7: GetCurrentDateTime

CFX_WideString CXFA_FFNotify::GetCurrentDateTime() {
  CFX_Unitime dataTime;
  dataTime.Now();
  CFX_WideString wsDateTime;
  wsDateTime.Format(L"%d%02d%02dT%02d%02d%02d", dataTime.GetYear(),
                    dataTime.GetMonth(), dataTime.GetDay(), dataTime.GetHour(),
                    dataTime.GetMinute(), dataTime.GetSecond());
  return wsDateTime;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:9,代码来源:xfa_ffnotify.cpp

示例8: SetTime

FX_BOOL CXFA_LocaleValue::SetTime(const CFX_Unitime& t) {
  m_dwType = XFA_VT_TIME;
  m_wsValue.Format(L"%02d:%02d:%02d", t.GetHour(), t.GetMinute(),
                   t.GetSecond());
  if (t.GetMillisecond() > 0) {
    CFX_WideString wsTemp;
    wsTemp.Format(L"%:03d", t.GetMillisecond());
    m_wsValue += wsTemp;
  }
  return TRUE;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:11,代码来源:xfa_localevalue.cpp

示例9: SetDateTime

FX_BOOL CXFA_LocaleValue::SetDateTime(const CFX_Unitime& dt) {
  m_dwType = XFA_VT_DATETIME;
  m_wsValue.Format(L"%04d-%02d-%02dT%02d:%02d:%02d", dt.GetYear(),
                   dt.GetMonth(), dt.GetDay(), dt.GetHour(), dt.GetMinute(),
                   dt.GetSecond());
  if (dt.GetMillisecond() > 0) {
    CFX_WideString wsTemp;
    wsTemp.Format(L"%:03d", dt.GetMillisecond());
    m_wsValue += wsTemp;
  }
  return TRUE;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:12,代码来源:xfa_localevalue.cpp

示例10: byteToChar

FX_BOOL util::byteToChar(OBJ_METHOD_PARAMS)
{
	int iSize = params.size();
	if (iSize == 0)
		return FALSE;
	int nByte = (int)params[0];
	unsigned char cByte = (unsigned char)nByte;
	CFX_WideString csValue;
	csValue.Format((FX_LPCWSTR)L"%c", cByte);
	vRet = csValue; 
	return TRUE;
}
开发者ID:151706061,项目名称:PDFium,代码行数:12,代码来源:util.cpp

示例11: byteToChar

FX_BOOL util::byteToChar(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
{
	int iSize = params.size();
	if (iSize == 0)
		return FALSE;
	int nByte = params[0].ToInt();
	unsigned char cByte = (unsigned char)nByte;
	CFX_WideString csValue;
	csValue.Format(L"%c", cByte);
	vRet = csValue.c_str();
	return TRUE;
}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:12,代码来源:util.cpp

示例12: SetColor

void CXFA_Stroke::SetColor(FX_ARGB argb) {
  if (!m_pNode)
    return;

  CXFA_Node* pNode = m_pNode->GetProperty(0, XFA_Element::Color);
  CFX_WideString wsColor;
  int a;
  int r;
  int g;
  int b;
  ArgbDecode(argb, a, r, g, b);
  wsColor.Format(L"%d,%d,%d", r, g, b);
  pNode->SetCData(XFA_ATTRIBUTE_Value, wsColor);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:14,代码来源:cxfa_stroke.cpp

示例13: 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

示例14: ValidateNumberField

void CXFA_FFTextEdit::ValidateNumberField(const CFX_WideString& wsText) {
  CXFA_WidgetAcc* pAcc = GetDataAcc();
  if (pAcc && pAcc->GetUIType() == XFA_Element::NumericEdit) {
    IXFA_AppProvider* pAppProvider = GetApp()->GetAppProvider();
    if (pAppProvider) {
      CFX_WideString wsTitle;
      pAppProvider->LoadString(XFA_IDS_AppName, wsTitle);
      CFX_WideString wsError;
      pAppProvider->LoadString(XFA_IDS_ValidateNumberError, wsError);
      CFX_WideString wsSomField;
      pAcc->GetNode()->GetSOMExpression(wsSomField);
      CFX_WideString wsMessage;
      wsMessage.Format(wsError.c_str(), wsText.c_str(), wsSomField.c_str());
      pAppProvider->MsgBox(wsMessage, wsTitle, XFA_MBICON_Error, XFA_MB_OK);
    }
  }
}
开发者ID:documentcloud,项目名称:pdfium,代码行数:17,代码来源:xfa_fftextedit.cpp

示例15: SetDateTime

void CPWL_NoteItem::SetDateTime(FX_SYSTEMTIME time)
{
	m_dtNote = time;
	
	CFX_WideString swTime;
	swTime.Format((FX_LPCWSTR)L"%04d-%02d-%02d %02d:%02d:%02d", time.wYear, time.wMonth, time.wDay, time.wHour, time.wMinute, time.wSecond);
	if (m_pDateTime)
	{
		m_pDateTime->SetText(swTime);
	}

	this->RePosChildWnd();

	if (IPWL_NoteNotify* pNotify = GetNoteNotify())
	{
		pNotify->OnSetDateTime(this);
	}
}
开发者ID:HelloZhu,项目名称:PDFium.js,代码行数:18,代码来源:PWL_Note.cpp


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