Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Side by Side Diff: xfa/fde/css/fde_csssyntax.cpp

Issue 2535723010: Rename IFX_Stream to IFGAS_Stream. (Closed)
Patch Set: rename more to IFGAS, {} Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fde/css/fde_csssyntax.h ('k') | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "xfa/fde/css/fde_csssyntax.h" 7 #include "xfa/fde/css/fde_csssyntax.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 17 matching lines...) Expand all
28 m_dwCheck((uint32_t)-1), 28 m_dwCheck((uint32_t)-1),
29 m_eMode(FDE_CSSSYNTAXMODE_RuleSet), 29 m_eMode(FDE_CSSSYNTAXMODE_RuleSet),
30 m_eStatus(FDE_CSSSYNTAXSTATUS_None), 30 m_eStatus(FDE_CSSSYNTAXSTATUS_None),
31 m_ModeStack(100) {} 31 m_ModeStack(100) {}
32 32
33 CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() { 33 CFDE_CSSSyntaxParser::~CFDE_CSSSyntaxParser() {
34 m_TextData.Reset(); 34 m_TextData.Reset();
35 m_TextPlane.Reset(); 35 m_TextPlane.Reset();
36 } 36 }
37 37
38 bool CFDE_CSSSyntaxParser::Init(IFX_Stream* pStream, 38 bool CFDE_CSSSyntaxParser::Init(IFGAS_Stream* pStream,
39 int32_t iCSSPlaneSize, 39 int32_t iCSSPlaneSize,
40 int32_t iTextDataSize, 40 int32_t iTextDataSize,
41 bool bOnlyDeclaration) { 41 bool bOnlyDeclaration) {
42 ASSERT(pStream && iCSSPlaneSize > 0 && iTextDataSize > 0); 42 ASSERT(pStream && iCSSPlaneSize > 0 && iTextDataSize > 0);
43 Reset(bOnlyDeclaration); 43 Reset(bOnlyDeclaration);
44 if (!m_TextData.EstimateSize(iTextDataSize)) { 44 if (!m_TextData.EstimateSize(iTextDataSize)) {
45 return false; 45 return false;
46 } 46 }
47 uint8_t bom[4]; 47 uint8_t bom[4];
48 m_pStream = pStream; 48 m_pStream = pStream;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 m_pBuffer = const_cast<FX_WCHAR*>(pBuffer); 426 m_pBuffer = const_cast<FX_WCHAR*>(pBuffer);
427 m_iDatLen = m_iBufLen = iBufLen; 427 m_iDatLen = m_iBufLen = iBufLen;
428 return m_bExtBuf = true; 428 return m_bExtBuf = true;
429 } 429 }
430 bool CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) { 430 bool CFDE_CSSTextBuf::EstimateSize(int32_t iAllocSize) {
431 ASSERT(iAllocSize > 0); 431 ASSERT(iAllocSize > 0);
432 Clear(); 432 Clear();
433 m_bExtBuf = false; 433 m_bExtBuf = false;
434 return ExpandBuf(iAllocSize); 434 return ExpandBuf(iAllocSize);
435 } 435 }
436 int32_t CFDE_CSSTextBuf::LoadFromStream(IFX_Stream* pTxtStream, 436 int32_t CFDE_CSSTextBuf::LoadFromStream(IFGAS_Stream* pTxtStream,
437 int32_t iStreamOffset, 437 int32_t iStreamOffset,
438 int32_t iMaxChars, 438 int32_t iMaxChars,
439 bool& bEOS) { 439 bool& bEOS) {
440 ASSERT(iStreamOffset >= 0 && iMaxChars > 0); 440 ASSERT(iStreamOffset >= 0 && iMaxChars > 0);
441 Clear(); 441 Clear();
442 m_bExtBuf = false; 442 m_bExtBuf = false;
443 if (!ExpandBuf(iMaxChars)) { 443 if (!ExpandBuf(iMaxChars)) {
444 return 0; 444 return 0;
445 } 445 }
446 if (pTxtStream->GetPosition() != iStreamOffset) { 446 if (pTxtStream->GetPosition() != iStreamOffset) {
(...skipping 20 matching lines...) Expand all
467 m_iBufLen = iDesiredSize; 467 m_iBufLen = iDesiredSize;
468 return true; 468 return true;
469 } 469 }
470 470
471 void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) { 471 void CFDE_CSSTextBuf::Subtract(int32_t iStart, int32_t iLength) {
472 ASSERT(iStart >= 0 && iLength >= 0); 472 ASSERT(iStart >= 0 && iLength >= 0);
473 iLength = std::max(std::min(iLength, m_iDatLen - iStart), 0); 473 iLength = std::max(std::min(iLength, m_iDatLen - iStart), 0);
474 FXSYS_memmove(m_pBuffer, m_pBuffer + iStart, iLength * sizeof(FX_WCHAR)); 474 FXSYS_memmove(m_pBuffer, m_pBuffer + iStart, iLength * sizeof(FX_WCHAR));
475 m_iDatLen = iLength; 475 m_iDatLen = iLength;
476 } 476 }
OLDNEW
« no previous file with comments | « xfa/fde/css/fde_csssyntax.h ('k') | xfa/fde/xml/fde_xml_imp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698