您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CFX_WideString函数代码示例

51自学网 2021-06-01 19:59:35
  C++
这篇教程C++ CFX_WideString函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CFX_WideString函数的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString函数的具体用法?C++ CFX_WideString怎么用?C++ CFX_WideString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: FGAS_GetUnicodeBitField

CFGAS_GEFont* CFGAS_FontMgr::GetFontByUnicode(FX_WCHAR wUnicode,                                              uint32_t dwFontStyles,                                              const FX_WCHAR* pszFontFamily) {  CFGAS_GEFont* pFont = nullptr;  if (m_FailedUnicodes2Nullptr.Lookup(wUnicode, pFont))    return nullptr;  const FGAS_FONTUSB* x = FGAS_GetUnicodeBitField(wUnicode);  uint16_t wCodePage = x ? x->wCodePage : 0xFFFF;  uint16_t wBitField = x ? x->wBitField : 0x03E7;  CFX_ByteString bsHash;  if (wCodePage == 0xFFFF)    bsHash.Format("%d, %d, %d", wCodePage, wBitField, dwFontStyles);  else    bsHash.Format("%d, %d", wCodePage, dwFontStyles);  bsHash += CFX_WideString(pszFontFamily).UTF8Encode();  uint32_t dwHash = FX_HashCode_GetA(bsHash.AsStringC(), false);  CFX_ArrayTemplate<CFGAS_GEFont*>* pFonts = nullptr;  if (m_Hash2Fonts.Lookup(dwHash, pFonts)) {    if (!pFonts)      return nullptr;    for (int32_t i = 0; i < pFonts->GetSize(); ++i) {      if (VerifyUnicode(pFonts->GetAt(i), wUnicode))        return pFonts->GetAt(i)->Retain();    }  }  if (!pFonts)    pFonts = new CFX_ArrayTemplate<CFGAS_GEFont*>;  m_Hash2Fonts.SetAt(dwHash, pFonts);  CFX_FontDescriptorInfos* sortedFonts = nullptr;  if (!m_Hash2CandidateList.Lookup(dwHash, sortedFonts)) {    sortedFonts = new CFX_FontDescriptorInfos;    MatchFonts(*sortedFonts, wCodePage, dwFontStyles,               CFX_WideString(pszFontFamily), wUnicode);    m_Hash2CandidateList.SetAt(dwHash, sortedFonts);  }  for (int32_t i = 0; i < sortedFonts->GetSize(); ++i) {    CFX_FontDescriptor* pDesc = sortedFonts->GetAt(i).pFont;    if (!VerifyUnicode(pDesc, wUnicode))      continue;    pFont = LoadFont(pDesc->m_wsFaceName, pDesc->m_nFaceIndex, nullptr);    if (!pFont)      continue;    pFont->SetLogicalFontStyle(dwFontStyles);    pFonts->Add(pFont);    return pFont;  }  if (!pszFontFamily)    m_FailedUnicodes2Nullptr.SetAt(wUnicode, nullptr);  return nullptr;}
开发者ID:documentcloud,项目名称:pdfium,代码行数:51,


示例2: CFX_WideString

FX_BOOL util::printx(OBJ_METHOD_PARAMS){	int iSize = params.size();	if (iSize<2)		return FALSE;	CFX_WideString sFormat = params[0].operator CFX_WideString();	CFX_WideString sSource = params[1].operator CFX_WideString();	std::string cFormat = (FX_LPCSTR)CFX_ByteString::FromUnicode(sFormat);	std::string cSource = (FX_LPCSTR)CFX_ByteString::FromUnicode(sSource);	std::string cDest;	printx(cFormat,cSource,cDest);	vRet = cDest.c_str();	return TRUE;}
开发者ID:151706061,项目名称:PDFium,代码行数:14,


示例3: ToArray

CFX_WideString CPDF_FormField::GetOptionText(int index, int sub_index) const {  CPDF_Array* pArray = ToArray(FPDF_GetFieldAttr(m_pDict, "Opt"));  if (!pArray)    return CFX_WideString();  CPDF_Object* pOption = pArray->GetDirectObjectAt(index);  if (!pOption)    return CFX_WideString();  if (CPDF_Array* pOptionArray = pOption->AsArray())    pOption = pOptionArray->GetDirectObjectAt(sub_index);  CPDF_String* pString = ToString(pOption);  return pString ? pString->GetUnicodeText() : CFX_WideString();}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:14,


示例4: CFX_WideString

int CPDFDoc_Environment::JS_appAlert(const FX_WCHAR* Msg, const FX_WCHAR* Title, FX_UINT Type, FX_UINT Icon){    if (m_pInfo && m_pInfo->m_pJsPlatform && m_pInfo->m_pJsPlatform->app_alert)    {        CFX_ByteString bsMsg = CFX_WideString(Msg).UTF16LE_Encode();        CFX_ByteString bsTitle = CFX_WideString(Title).UTF16LE_Encode();        FPDF_WIDESTRING pMsg = (FPDF_WIDESTRING)bsMsg.GetBuffer(bsMsg.GetLength());        FPDF_WIDESTRING pTitle = (FPDF_WIDESTRING)bsTitle.GetBuffer(bsTitle.GetLength());        int ret = m_pInfo->m_pJsPlatform->app_alert(m_pInfo->m_pJsPlatform, pMsg, pTitle, Type, Icon);        bsMsg.ReleaseBuffer();        bsTitle.ReleaseBuffer();        return ret;    }    return -1;}
开发者ID:chenjian-rits,项目名称:pdfium,代码行数:15,


示例5: GetUnicodeFromCharCode

CFX_WideString CPDF_CIDFont::UnicodeFromCharCode(uint32_t charcode) const {  CFX_WideString str = CPDF_Font::UnicodeFromCharCode(charcode);  if (!str.IsEmpty())    return str;  FX_WCHAR ret = GetUnicodeFromCharCode(charcode);  return ret ? ret : CFX_WideString();}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:7,


示例6: FX_OpenFolder

CFX_ByteString CFX_FontSourceEnum_File::GetNextFile() {Restart:  void* pCurHandle =      m_FolderQueue.GetSize() != 0          ? m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->pFileHandle          : nullptr;  if (!pCurHandle) {    if (m_FolderPaths.GetSize() < 1) {      return "";    }    pCurHandle =        FX_OpenFolder(m_FolderPaths[m_FolderPaths.GetSize() - 1].c_str());    FX_HandleParentPath hpp;    hpp.pFileHandle = pCurHandle;    hpp.bsParentPath = m_FolderPaths[m_FolderPaths.GetSize() - 1];    m_FolderQueue.Add(hpp);  }  CFX_ByteString bsName;  FX_BOOL bFolder;  CFX_ByteString bsFolderSpearator =      CFX_ByteString::FromUnicode(CFX_WideString(FX_GetFolderSeparator()));  while (TRUE) {    if (!FX_GetNextFile(pCurHandle, bsName, bFolder)) {      FX_CloseFolder(pCurHandle);      m_FolderQueue.RemoveAt(m_FolderQueue.GetSize() - 1);      if (m_FolderQueue.GetSize() == 0) {        m_FolderPaths.RemoveAt(m_FolderPaths.GetSize() - 1);        if (m_FolderPaths.GetSize() == 0) {          return "";        } else {          goto Restart;        }      }      pCurHandle =          m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->pFileHandle;      continue;    }    if (bsName == "." || bsName == "..") {      continue;    }    if (bFolder) {      FX_HandleParentPath hpp;      hpp.bsParentPath =          m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->bsParentPath +          bsFolderSpearator + bsName;      hpp.pFileHandle = FX_OpenFolder(hpp.bsParentPath.c_str());      if (!hpp.pFileHandle) {        continue;      }      m_FolderQueue.Add(hpp);      pCurHandle = hpp.pFileHandle;      continue;    }    bsName =        m_FolderQueue.GetDataPtr(m_FolderQueue.GetSize() - 1)->bsParentPath +        bsFolderSpearator + bsName;    break;  }  return bsName;}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:60,


示例7: FILESPEC_DecodeFileName

static CFX_WideString FILESPEC_DecodeFileName(const CFX_WideStringC& filepath) {  if (filepath.GetLength() <= 1) {    return CFX_WideString();  }#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_  if (filepath.Left(sizeof("/Mac") - 1) == CFX_WideStringC(L"/Mac")) {    return ChangeSlashToPlatform(filepath.GetPtr() + 1);  }  return ChangeSlashToPlatform(filepath.GetPtr());#elif _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_  if (filepath.GetAt(0) != '/') {    return ChangeSlashToPlatform(filepath.GetPtr());  }  if (filepath.GetAt(1) == '/') {    return ChangeSlashToPlatform(filepath.GetPtr() + 1);  }  if (filepath.GetAt(2) == '/') {    CFX_WideString result;    result += filepath.GetAt(1);    result += ':';    result += ChangeSlashToPlatform(filepath.GetPtr() + 2);    return result;  }  CFX_WideString result;  result += '//';  result += ChangeSlashToPlatform(filepath.GetPtr());  return result;#else  return filepath;#endif}
开发者ID:andoma,项目名称:pdfium,代码行数:31,


示例8: CFX_WideString

CFX_WideString CBC_EdifactEncoder::encodeToCodewords(CFX_WideString sb,                                                     int32_t startPos,                                                     int32_t& e) {  int32_t len = sb.GetLength() - startPos;  if (len == 0) {    e = BCExceptionNoContents;    return CFX_WideString();  }  FX_WCHAR c1 = sb.GetAt(startPos);  FX_WCHAR c2 = len >= 2 ? sb.GetAt(startPos + 1) : 0;  FX_WCHAR c3 = len >= 3 ? sb.GetAt(startPos + 2) : 0;  FX_WCHAR c4 = len >= 4 ? sb.GetAt(startPos + 3) : 0;  int32_t v = (c1 << 18) + (c2 << 12) + (c3 << 6) + c4;  FX_WCHAR cw1 = (FX_WCHAR)((v >> 16) & 255);  FX_WCHAR cw2 = (FX_WCHAR)((v >> 8) & 255);  FX_WCHAR cw3 = (FX_WCHAR)(v & 255);  CFX_WideString res;  res += cw1;  if (len >= 2) {    res += cw2;  }  if (len >= 3) {    res += cw3;  }  return res;}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:26,


示例9: sizeof

CFX_WideString Document::CutString(CFX_WideString cbFrom){	size_t iLength = cbFrom.GetLength();	pdfium::base::CheckedNumeric<size_t> iSize = sizeof(wchar_t);	iSize *= (iLength + 1);	wchar_t* pResult = (wchar_t*)malloc(iSize.ValueOrDie());	wchar_t* pFrom = (wchar_t*)cbFrom.GetBuffer(iLength);	for (int i = 0; i < iLength; i++)	{		if (pFrom[i] == L'//' || pFrom[i] == L'/')		{			pResult[i] = L'/0';			break;		}		pResult[i] = pFrom[i];	}	pResult[iLength] = L'/0';	cbFrom.ReleaseBuffer();	CFX_WideString cbRet = CFX_WideString(pResult);	free(pResult);	pResult = NULL;	return cbRet;}
开发者ID:mcanthony,项目名称:libpdf,代码行数:25,


示例10: CFX_WideString

IFDE_CSSStyleSheet* IFDE_CSSStyleSheet::LoadHTMLStandardStyleSheet() {  static const FX_WCHAR* s_pStyle =      L"html,address,blockquote,body,dd,div,dl,dt,fieldset,form,frame,frameset,"      L"h1,h2,h3,h4,h5,h6,noframes,ol,p,ul,center,dir,hr,menu,pre{display:"      L"block}"      L"li{display:list-item}head{display:none}table{display:table}tr{display:"      L"table-row}thead{display:table-header-group}tbody{display:table-row-"      L"group}tfoot{display:table-footer-group}"      L"col{display:table-column}colgroup{display:table-column-group}td,th{"      L"display:table-cell}caption{display:table-caption}th{font-weight:bolder;"      L"text-align:center}caption{text-align:center}"      L"body{margin:0}h1{font-size:2em;margin:.67em "      L"0}h2{font-size:1.5em;margin:.75em 0}h3{font-size:1.17em;margin:.83em "      L"0}h4,p,blockquote,ul,fieldset,form,ol,dl,dir,menu{margin:1.12em 0}"      L"h5{font-size:.83em;margin:1.5em 0}h6{font-size:.75em;margin:1.67em "      L"0}h1,h2,h3,h4,h5,h6,b,strong{font-weight:bolder}blockquote{margin-left:"      L"40px;margin-right:40px}i,cite,em,var,address{font-style:italic}"      L"pre,tt,code,kbd,samp{font-family:monospace}pre{white-space:pre}button,"      L"textarea,input,select{display:inline-block}big{font-size:1.17em}small,"      L"sub,sup{font-size:.83em}sub{vertical-align:sub}"      L"sup{vertical-align:super}table{border-spacing:2px}thead,tbody,tfoot{"      L"vertical-align:middle}td,th,tr{vertical-align:inherit}s,strike,del{"      L"text-decoration:line-through}hr{border:1px inset silver}"      L"ol,ul,dir,menu,dd{margin-left:40px}ol{list-style-type:decimal}ol ul,ul "      L"ol,ul ul,ol "      L"ol{margin-top:0;margin-bottom:0}u,ins{text-decoration:underline}center{"      L"text-align:center}"      L"ruby{display:ruby}rt{display:ruby-text;font-size:.5em}rb{display:ruby-"      L"base}rbc{display:ruby-base-group}rtc{display:ruby-text-group}"      L"q:before{content:open-quote}q:after{content:close-quote}"      L"rp{display:none}";  return IFDE_CSSStyleSheet::LoadFromBuffer(      CFX_WideString(), s_pStyle, FXSYS_wcslen(s_pStyle), FX_CODEPAGE_UTF8);}
开发者ID:andoma,项目名称:pdfium,代码行数:34,


示例11: name_extractor

CPDF_FormField* CFieldTree::RemoveField(const CFX_WideString& full_name) {  if (full_name == L"")    return nullptr;  CFieldNameExtractor name_extractor(full_name);  const FX_WCHAR* pName;  FX_STRSIZE nLength;  name_extractor.GetNext(pName, nLength);  Node* pNode = &m_Root;  Node* pLast = nullptr;  while (nLength > 0 && pNode) {    pLast = pNode;    CFX_WideString name = CFX_WideString(pName, nLength);    pNode = Lookup(pLast, name);    name_extractor.GetNext(pName, nLength);  }  if (pNode && pNode != &m_Root) {    for (int i = 0; i < pLast->children.GetSize(); i++) {      if (pNode == pLast->children[i]) {        pLast->children.RemoveAt(i);        break;      }    }    CPDF_FormField* pField = pNode->field_ptr;    RemoveNode(pNode);    return pField;  }  return nullptr;}
开发者ID:gradescope,项目名称:pdfium,代码行数:30,


示例12: GetElement

CFX_WideString CPDF_Dictionary::GetUnicodeText(const CFX_ByteStringC& key,                                               CFX_CharMap* pCharMap) const {  CPDF_Object* p = GetElement(key);  if (CPDF_Reference* pRef = ToReference(p))    p = pRef->GetDirect();  return p ? p->GetUnicodeText(pCharMap) : CFX_WideString();}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:7,


示例13: WSToJSString

v8::Handle<v8::String> WSToJSString(IJS_Runtime* pJSRuntime, const wchar_t* PropertyName, int Len = -1){	CFX_WideString ws = CFX_WideString(PropertyName,Len);	CFX_ByteString bs = ws.UTF8Encode();	if(!pJSRuntime) pJSRuntime = v8::Isolate::GetCurrent();	return v8::String::NewFromUtf8(pJSRuntime, bs.c_str());}
开发者ID:mcanthony,项目名称:libpdf,代码行数:7,


示例14: CFX_WideString

CFX_WideString CFPF_SkiaFont::GetPsName(){    if (!m_Face) {        return CFX_WideString();    }    return CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face));}
开发者ID:WHS-TechOps,项目名称:Aviator,代码行数:7,


示例15: CFX_WideString

CFX_WideString CPDF_Object::GetUnicodeText(CFX_CharMap* pCharMap) const{    if (this == NULL) {        return CFX_WideString();    }    if (m_Type == PDFOBJ_STRING) {        return PDF_DecodeText(((CPDF_String*)this)->m_String, pCharMap);    } else if (m_Type == PDFOBJ_STREAM) {        CPDF_StreamAcc stream;        stream.LoadAllData((CPDF_Stream*)this, FALSE);        CFX_WideString result = PDF_DecodeText(stream.GetData(), stream.GetSize(), pCharMap);        return result;    } else if (m_Type == PDFOBJ_NAME) {        return PDF_DecodeText(((CPDF_Name*)this)->m_Name, pCharMap);    }    return CFX_WideString();}
开发者ID:MWisBest,项目名称:android_external_pdfium,代码行数:17,


示例16: TEST_F

TEST_F(FXJSV8EmbedderTest, Getters) {  v8::Isolate::Scope isolate_scope(isolate());  v8::HandleScope handle_scope(isolate());  v8::Context::Scope context_scope(GetV8Context());  ExecuteInCurrentContext(CFX_WideString(kScript1));  CheckAssignmentInCurrentContext(kExpected1);}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:8,


示例17: FPDF_GetFieldAttr

CFX_WideString CPDF_FormField::GetOptionText(int index, int sub_index) {  CPDF_Object* pValue = FPDF_GetFieldAttr(m_pDict, "Opt");  if (pValue == NULL || pValue->GetType() != PDFOBJ_ARRAY) {    return CFX_WideString();  }  CPDF_Object* pOption = ((CPDF_Array*)pValue)->GetElementValue(index);  if (pOption == NULL) {    return CFX_WideString();  }  if (pOption->GetType() == PDFOBJ_ARRAY) {    pOption = ((CPDF_Array*)pOption)->GetElementValue(sub_index);  }  if (pOption == NULL || pOption->GetType() != PDFOBJ_STRING) {    return CFX_WideString();  }  return ((CPDF_String*)pOption)->GetUnicodeText();}
开发者ID:azunite,项目名称:libpdfium,代码行数:17,


示例18: CFX_WideString

CFX_WideString CPWL_ComboBox::GetText() const{	if (m_pEdit)	{		return m_pEdit->GetText();	}	return CFX_WideString();}
开发者ID:151706061,项目名称:PDFium,代码行数:8,


示例19: CFX_WideString

CFX_WideString CXML_Element::GetContent(uint32_t index) const {  if (index < m_Children.size() && m_Children[index].type == Content) {    CXML_Content* pContent =        static_cast<CXML_Content*>(m_Children[index].child);    if (pContent)      return pContent->m_Content;  }  return CFX_WideString();}
开发者ID:documentcloud,项目名称:pdfium,代码行数:9,


示例20: CFX_WideString

FX_BOOL CXML_Element::GetAttrValue(FX_BSTR space, FX_BSTR name, CFX_WideString& attribute) const{    const CFX_WideString* pValue = m_AttrMap.Lookup(space, name);    if (pValue) {        attribute = CFX_WideString((FX_LPCWSTR)pValue, pValue->GetLength());        return TRUE;    }    return FALSE;}
开发者ID:HelloZhu,项目名称:PDFium.js,代码行数:9,


示例21: isolate_scope

void CFXJS_Engine::DefineObjConst(int nObjDefnID,                                  const wchar_t* sConstName,                                  v8::Local<v8::Value> pDefault) {  v8::Isolate::Scope isolate_scope(m_isolate);  v8::HandleScope handle_scope(m_isolate);  CFX_ByteString bsConstName = CFX_WideString(sConstName).UTF8Encode();  CFXJS_ObjDefinition* pObjDef =      CFXJS_ObjDefinition::ForID(m_isolate, nObjDefnID);  pObjDef->GetInstanceTemplate()->Set(m_isolate, bsConstName.c_str(), pDefault);}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:10,


示例22: CFX_WideString

CFX_WideString CPDF_Bookmark::GetTitle(){    if (!m_pDict) {        return CFX_WideString();    }    CPDF_String* pString = (CPDF_String*)m_pDict->GetElementValue("Title");    if (pString == NULL || pString->GetType() != PDFOBJ_STRING) {        return CFX_WideString();    }    CFX_WideString title = pString->GetUnicodeText();    FX_LPWSTR buf = title.LockBuffer();    int len = title.GetLength(), i;    for (i = 0; i < len; i ++)        if (buf[i] < 0x20) {            buf[i] = 0x20;        }    title.ReleaseBuffer(len);    return title;}
开发者ID:MWisBest,项目名称:android_external_pdfium,代码行数:19,


示例23: CFX_WideString

CFX_WideString CFX_Font::GetPsName() const{    if (m_Face == NULL) {        return CFX_WideString();    }    CFX_WideString psName = CFX_WideString::FromLocal(FXFT_Get_Postscript_Name(m_Face));    if (psName.IsEmpty()) {        psName =  CFX_WideString::FromLocal("Untitled");    }    return psName;}
开发者ID:ioctaptceb,项目名称:node-pdfium,代码行数:11,


示例24: CFX_WideString

CFX_WideString CFX_WideString::FromUTF8(const char* str, FX_STRSIZE len) {  if (!str || 0 == len) {    return CFX_WideString();  }  CFX_UTF8Decoder decoder;  for (FX_STRSIZE i = 0; i < len; i++) {    decoder.Input(str[i]);  }  return decoder.GetResult();}
开发者ID:hoanganhx86,项目名称:pdfium,代码行数:11,



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


C++ CFormat函数代码示例
C++ CFX_ByteString函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。