bool CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl,
                                        const FX_WCHAR* pBuffer,
                                        int32_t iBufSize,
                                        uint16_t wCodePage) {
  ASSERT(pBuffer && iBufSize > 0);
  std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser);
  bool bRet = pSyntax->Init(pBuffer, iBufSize) && LoadFromSyntax(pSyntax.get());
  m_wCodePage = wCodePage;
  m_szUrl = szUrl;
  return bRet;
}
bool CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl,
                                        IFX_Stream* pStream,
                                        uint16_t wCodePage) {
  std::unique_ptr<CFDE_CSSSyntaxParser> pSyntax(new CFDE_CSSSyntaxParser);
  if (pStream->GetCodePage() != wCodePage)
    pStream->SetCodePage(wCodePage);

  bool bRet = pSyntax->Init(pStream, 4096) && LoadFromSyntax(pSyntax.get());
  m_wCodePage = wCodePage;
  m_szUrl = szUrl;
  return bRet;
}
Example #3
0
FX_BOOL CFDE_CSSStyleSheet::LoadFromBuffer(const CFX_WideString& szUrl,
                                           const FX_WCHAR* pBuffer,
                                           int32_t iBufSize,
                                           FX_WORD wCodePage) {
  FXSYS_assert(pBuffer != NULL && iBufSize > 0);
  IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create();
  if (pSyntax == NULL) {
    return FALSE;
  }
  FX_BOOL bRet = pSyntax->Init(pBuffer, iBufSize) && LoadFromSyntax(pSyntax);
  pSyntax->Release();
  m_wCodePage = wCodePage;
  m_szUrl = szUrl;
  return bRet;
}
Example #4
0
FX_BOOL CFDE_CSSStyleSheet::LoadFromStream(const CFX_WideString& szUrl,
                                           IFX_Stream* pStream,
                                           FX_WORD wCodePage) {
  FXSYS_assert(pStream != NULL);
  IFDE_CSSSyntaxParser* pSyntax = IFDE_CSSSyntaxParser::Create();
  if (pSyntax == NULL) {
    return FALSE;
  }
  if (pStream->GetCodePage() != wCodePage) {
    pStream->SetCodePage(wCodePage);
  }
  FX_BOOL bRet = pSyntax->Init(pStream, 4096) && LoadFromSyntax(pSyntax);
  pSyntax->Release();
  m_wCodePage = wCodePage;
  m_szUrl = szUrl;
  return bRet;
}