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


C++ ToDictionary函数代码示例

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


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

示例1: ToDictionary

CPDF_Dictionary* CPDF_Document::GetPage(int iPage) {
  if (iPage < 0 || iPage >= m_PageList.GetSize())
    return nullptr;

  if (m_bLinearized && (iPage == m_iFirstPageNo)) {
    if (CPDF_Dictionary* pDict =
            ToDictionary(GetOrParseIndirectObject(m_dwFirstPageObjNum))) {
      return pDict;
    }
  }

  int objnum = m_PageList.GetAt(iPage);
  if (objnum) {
    if (CPDF_Dictionary* pDict = ToDictionary(GetOrParseIndirectObject(objnum)))
      return pDict;
  }

  CPDF_Dictionary* pPages = GetPagesDict();
  if (!pPages)
    return nullptr;

  CPDF_Dictionary* pPage = FindPDFPage(pPages, iPage, iPage, 0);
  if (!pPage)
    return nullptr;

  m_PageList.SetAt(iPage, pPage->GetObjNum());
  return pPage;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:28,代码来源:cpdf_document.cpp

示例2: ToDictionary

CPDF_Dictionary* CPDF_Document::GetPage(int iPage) {
    if (iPage < 0 || iPage >= m_PageList.GetSize())
        return nullptr;

    if (m_bLinearized && (iPage == (int)m_dwFirstPageNo)) {
        if (CPDF_Dictionary* pDict =
                    ToDictionary(GetIndirectObject(m_dwFirstPageObjNum, nullptr)))
            return pDict;
    }

    int objnum = m_PageList.GetAt(iPage);
    if (objnum) {
        if (CPDF_Dictionary* pDict =
                    ToDictionary(GetIndirectObject(objnum, nullptr))) {
            return pDict;
        }
    }

    CPDF_Dictionary* pRoot = GetRoot();
    if (!pRoot)
        return nullptr;

    CPDF_Dictionary* pPages = pRoot->GetDict("Pages");
    if (!pPages)
        return nullptr;

    CPDF_Dictionary* pPage = _FindPDFPage(pPages, iPage, iPage, 0);
    if (!pPage)
        return nullptr;

    m_PageList.SetAt(iPage, pPage->GetObjNum());
    return pPage;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:33,代码来源:fpdf_parser_document.cpp

示例3: ToDictionary

CPDF_Object* CPDF_PageOrganizer::PageDictGetInheritableTag(
    CPDF_Dictionary* pDict,
    const CFX_ByteString& bsSrcTag) {
  if (!pDict || bsSrcTag.IsEmpty())
    return nullptr;
  if (!pDict->KeyExist("Parent") || !pDict->KeyExist("Type"))
    return nullptr;

  CPDF_Object* pType = pDict->GetObjectFor("Type")->GetDirect();
  if (!ToName(pType))
    return nullptr;
  if (pType->GetString().Compare("Page"))
    return nullptr;

  CPDF_Dictionary* pp =
      ToDictionary(pDict->GetObjectFor("Parent")->GetDirect());
  if (!pp)
    return nullptr;

  if (pDict->KeyExist(bsSrcTag))
    return pDict->GetObjectFor(bsSrcTag);

  while (pp) {
    if (pp->KeyExist(bsSrcTag))
      return pp->GetObjectFor(bsSrcTag);
    if (!pp->KeyExist("Parent"))
      break;
    pp = ToDictionary(pp->GetObjectFor("Parent")->GetDirect());
  }
  return nullptr;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:31,代码来源:fpdfppo.cpp

示例4: FPDFPageObj_HasTransparency

DLLEXPORT FPDF_BOOL STDCALL
FPDFPageObj_HasTransparency(FPDF_PAGEOBJECT pageObject) {
  if (!pageObject)
    return FALSE;

  CPDF_PageObject* pPageObj = reinterpret_cast<CPDF_PageObject*>(pageObject);
  int blend_type = pPageObj->m_GeneralState.GetBlendType();
  if (blend_type != FXDIB_BLEND_NORMAL)
    return TRUE;

  CPDF_Dictionary* pSMaskDict =
      ToDictionary(pPageObj->m_GeneralState.GetSoftMask());
  if (pSMaskDict)
    return TRUE;

  if (pPageObj->m_GeneralState.GetFillAlpha() != 1.0f)
    return TRUE;

  if (pPageObj->IsPath() && pPageObj->m_GeneralState.GetStrokeAlpha() != 1.0f) {
    return TRUE;
  }

  if (pPageObj->IsForm()) {
    const CPDF_Form* pForm = pPageObj->AsForm()->form();
    if (pForm) {
      int trans = pForm->m_Transparency;
      if ((trans & PDFTRANS_ISOLATED) || (trans & PDFTRANS_GROUP))
        return TRUE;
    }
  }

  return FALSE;
}
开发者ID:gradescope,项目名称:pdfium,代码行数:33,代码来源:fpdfeditpage.cpp

示例5: FPDFLink_GetAction

DLLEXPORT FPDF_ACTION STDCALL FPDFLink_GetAction(FPDF_LINK pDict) {
  if (!pDict)
    return nullptr;

  CPDF_Link link(ToDictionary(static_cast<CPDF_Object*>(pDict)));
  return link.GetAction().GetDict();
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:7,代码来源:fpdfdoc.cpp

示例6: CountInterFormFonts

FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict) {
  if (!pFormDict) {
    return 0;
  }
  CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
  if (!pDR) {
    return 0;
  }
  CPDF_Dictionary* pFonts = pDR->GetDict("Font");
  if (!pFonts) {
    return 0;
  }
  FX_DWORD dwCount = 0;
  for (const auto& it : *pFonts) {
    CPDF_Object* pObj = it.second;
    if (!pObj) {
      continue;
    }
    if (CPDF_Dictionary* pDirect = ToDictionary(pObj->GetDirect())) {
      if (pDirect->GetString("Type") == "Font") {
        dwCount++;
      }
    }
  }
  return dwCount;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:26,代码来源:doc_utils.cpp

示例7: GetInterFormFont

CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
                            CPDF_Document* pDocument,
                            FX_DWORD index,
                            CFX_ByteString& csNameTag) {
  if (!pFormDict) {
    return NULL;
  }
  CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
  if (!pDR) {
    return NULL;
  }
  CPDF_Dictionary* pFonts = pDR->GetDict("Font");
  if (!pFonts) {
    return NULL;
  }
  FX_DWORD dwCount = 0;
  for (const auto& it : *pFonts) {
    const CFX_ByteString& csKey = it.first;
    CPDF_Object* pObj = it.second;
    if (!pObj) {
      continue;
    }
    CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
    if (!pElement)
      continue;
    if (pElement->GetString("Type") != "Font")
      continue;
    if (dwCount == index) {
      csNameTag = csKey;
      return pDocument->LoadFont(pElement);
    }
    dwCount++;
  }
  return NULL;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:35,代码来源:doc_utils.cpp

示例8: FindInterFormFont

FX_BOOL FindInterFormFont(CPDF_Dictionary* pFormDict,
                          const CPDF_Font* pFont,
                          CFX_ByteString& csNameTag) {
  if (!pFormDict || !pFont) {
    return FALSE;
  }
  CPDF_Dictionary* pDR = pFormDict->GetDict("DR");
  if (!pDR) {
    return FALSE;
  }
  CPDF_Dictionary* pFonts = pDR->GetDict("Font");
  if (!pFonts) {
    return FALSE;
  }
  for (const auto& it : *pFonts) {
    const CFX_ByteString& csKey = it.first;
    CPDF_Object* pObj = it.second;
    if (!pObj) {
      continue;
    }
    CPDF_Dictionary* pElement = ToDictionary(pObj->GetDirect());
    if (!pElement)
      continue;
    if (pElement->GetString("Type") != "Font") {
      continue;
    }
    if (pFont->GetFontDict() == pElement) {
      csNameTag = csKey;
      return TRUE;
    }
  }
  return FALSE;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:33,代码来源:doc_utils.cpp

示例9: FPDFLink_GetQuadPoints

DLLEXPORT FPDF_BOOL STDCALL FPDFLink_GetQuadPoints(FPDF_LINK linkAnnot,
                                                   int quadIndex,
                                                   FS_QUADPOINTSF* quadPoints) {
  if (!linkAnnot || !quadPoints)
    return FALSE;
  CPDF_Dictionary* pAnnotDict =
      ToDictionary(static_cast<CPDF_Object*>(linkAnnot));
  CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
  if (pArray) {
    if (quadIndex < 0 ||
        static_cast<size_t>(quadIndex) >= pArray->GetCount() / 8 ||
        (static_cast<size_t>(quadIndex * 8 + 7) >= pArray->GetCount()))
      return FALSE;
    quadPoints->x1 = pArray->GetNumberAt(quadIndex * 8);
    quadPoints->y1 = pArray->GetNumberAt(quadIndex * 8 + 1);
    quadPoints->x2 = pArray->GetNumberAt(quadIndex * 8 + 2);
    quadPoints->y2 = pArray->GetNumberAt(quadIndex * 8 + 3);
    quadPoints->x3 = pArray->GetNumberAt(quadIndex * 8 + 4);
    quadPoints->y3 = pArray->GetNumberAt(quadIndex * 8 + 5);
    quadPoints->x4 = pArray->GetNumberAt(quadIndex * 8 + 6);
    quadPoints->y4 = pArray->GetNumberAt(quadIndex * 8 + 7);
    return TRUE;
  }
  return FALSE;
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:25,代码来源:fpdfdoc.cpp

示例10: ASSERT

CPDF_Action CPDF_DocJSActions::GetJSAction(const CFX_ByteString& csName) const {
  ASSERT(m_pDocument);
  CPDF_NameTree name_tree(m_pDocument, "JavaScript");
  CPDF_Object* pAction = name_tree.LookupValue(csName);
  if (!ToDictionary(pAction)) {
    return CPDF_Action();
  }
  return CPDF_Action(pAction->GetDict());
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:9,代码来源:doc_action.cpp

示例11: GetString

void CPDF_StreamContentParser::Handle_SetExtendGraphState() {
  CFX_ByteString name = GetString(0);
  CPDF_Dictionary* pGS = ToDictionary(FindResourceObj("ExtGState", name));
  if (!pGS) {
    m_bResourceMissing = TRUE;
    return;
  }
  m_pCurStates->ProcessExtGS(pGS, this);
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:9,代码来源:fpdf_page_parser.cpp

示例12: FPDFLink_CountQuadPoints

DLLEXPORT int STDCALL FPDFLink_CountQuadPoints(FPDF_LINK linkAnnot) {
  if (!linkAnnot)
    return 0;
  CPDF_Dictionary* pAnnotDict =
      ToDictionary(static_cast<CPDF_Object*>(linkAnnot));
  CPDF_Array* pArray = pAnnotDict->GetArrayFor("QuadPoints");
  if (!pArray)
    return 0;
  return static_cast<int>(pArray->GetCount() / 8);
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:10,代码来源:fpdfdoc.cpp

示例13: FPDFAction_GetDest

DLLEXPORT FPDF_DEST STDCALL FPDFAction_GetDest(FPDF_DOCUMENT document,
                                               FPDF_ACTION pDict) {
  if (!pDict)
    return nullptr;
  CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
  if (!pDoc)
    return nullptr;
  CPDF_Action action(ToDictionary(static_cast<CPDF_Object*>(pDict)));
  return action.GetDest(pDoc).GetObject();
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:10,代码来源:fpdfdoc.cpp

示例14: FPDFBookmark_GetFirstChild

DLLEXPORT FPDF_BOOKMARK STDCALL
FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) {
  CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
  if (!pDoc)
    return nullptr;
  CPDF_BookmarkTree tree(pDoc);
  CPDF_Bookmark bookmark =
      CPDF_Bookmark(ToDictionary(static_cast<CPDF_Object*>(pDict)));
  return tree.GetFirstChild(bookmark).GetDict();
}
开发者ID:hfiguiere,项目名称:pdfium,代码行数:10,代码来源:fpdfdoc.cpp

示例15: ToDictionary

CPDF_FormField* CPDF_InterForm::GetFieldInCalculationOrder(int index) {
  if (!m_pFormDict || index < 0)
    return nullptr;

  CPDF_Array* pArray = m_pFormDict->GetArrayFor("CO");
  if (!pArray)
    return nullptr;

  CPDF_Dictionary* pElement = ToDictionary(pArray->GetDirectObjectAt(index));
  return pElement ? GetFieldByDict(pElement) : nullptr;
}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:11,代码来源:cpdf_interform.cpp


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