diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-18 14:23:18 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-18 18:40:16 +0000 |
commit | 275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch) | |
tree | 2029b9158ec044764ceff122fe5fb5d0a3f123d1 /core/fpdfapi/page/cpdf_streamparser.cpp | |
parent | 450fbeaaabf1ab340c1018de2e58f1950657517e (diff) | |
download | pdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz |
Convert string class names
Automated using git grep & sed.
Replace StringC classes with StringView classes.
Remove the CFX_ prefix and put string classes in fxcrt namespace.
Change AsStringC() to AsStringView().
Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*,
Foo).
Couple of tests needed to have their names regularlized.
BUG=pdfium:894
Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d
Reviewed-on: https://pdfium-review.googlesource.com/14151
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamparser.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamparser.cpp | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/core/fpdfapi/page/cpdf_streamparser.cpp b/core/fpdfapi/page/cpdf_streamparser.cpp index f745331818..46cbfeb1fe 100644 --- a/core/fpdfapi/page/cpdf_streamparser.cpp +++ b/core/fpdfapi/page/cpdf_streamparser.cpp @@ -64,7 +64,7 @@ uint32_t DecodeInlineStream(const uint8_t* src_buf, uint32_t limit, int width, int height, - const CFX_ByteString& decoder, + const ByteString& decoder, CPDF_Dictionary* pParam, uint8_t** dest_buf, uint32_t* dest_size) { @@ -104,10 +104,9 @@ uint32_t DecodeInlineStream(const uint8_t* src_buf, CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize) : m_pBuf(pData), m_Size(dwSize), m_Pos(0), m_pPool(nullptr) {} -CPDF_StreamParser::CPDF_StreamParser( - const uint8_t* pData, - uint32_t dwSize, - const CFX_WeakPtr<CFX_ByteStringPool>& pPool) +CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, + uint32_t dwSize, + const CFX_WeakPtr<ByteStringPool>& pPool) : m_pBuf(pData), m_Size(dwSize), m_Pos(0), m_pPool(pPool) {} CPDF_StreamParser::~CPDF_StreamParser() {} @@ -122,7 +121,7 @@ std::unique_ptr<CPDF_Stream> CPDF_StreamParser::ReadInlineStream( if (PDFCharIsWhitespace(m_pBuf[m_Pos])) m_Pos++; - CFX_ByteString Decoder; + ByteString Decoder; CPDF_Dictionary* pParam = nullptr; CPDF_Object* pFilter = pDict->GetDirectObjectFor("Filter"); if (pFilter) { @@ -312,18 +311,18 @@ std::unique_ptr<CPDF_Object> CPDF_StreamParser::ReadNextObject( if (bIsNumber) { m_WordBuffer[m_WordSize] = 0; return pdfium::MakeUnique<CPDF_Number>( - CFX_ByteStringC(m_WordBuffer, m_WordSize)); + ByteStringView(m_WordBuffer, m_WordSize)); } int first_char = m_WordBuffer[0]; if (first_char == '/') { - CFX_ByteString name = - PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1)); + ByteString name = + PDF_NameDecode(ByteStringView(m_WordBuffer + 1, m_WordSize - 1)); return pdfium::MakeUnique<CPDF_Name>(m_pPool, name); } if (first_char == '(') { - CFX_ByteString str = ReadString(); + ByteString str = ReadString(); return pdfium::MakeUnique<CPDF_String>(m_pPool, str, false); } @@ -340,8 +339,8 @@ std::unique_ptr<CPDF_Object> CPDF_StreamParser::ReadNextObject( if (!m_WordSize || m_WordBuffer[0] != '/') return nullptr; - CFX_ByteString key = - PDF_NameDecode(CFX_ByteStringC(m_WordBuffer + 1, m_WordSize - 1)); + ByteString key = + PDF_NameDecode(ByteStringView(m_WordBuffer + 1, m_WordSize - 1)); std::unique_ptr<CPDF_Object> pObj = ReadNextObject(true, bInArray, dwRecursionLevel + 1); if (!pObj) @@ -464,9 +463,9 @@ void CPDF_StreamParser::GetNextWord(bool& bIsNumber) { } } -CFX_ByteString CPDF_StreamParser::ReadString() { +ByteString CPDF_StreamParser::ReadString() { if (!PositionIsInBounds()) - return CFX_ByteString(); + return ByteString(); uint8_t ch = m_pBuf[m_Pos++]; std::ostringstream buf; @@ -478,9 +477,9 @@ CFX_ByteString CPDF_StreamParser::ReadString() { case 0: if (ch == ')') { if (parlevel == 0) { - return CFX_ByteString(buf.str().c_str(), - std::min(static_cast<FX_STRSIZE>(buf.tellp()), - kMaxStringLength)); + return ByteString(buf.str().c_str(), + std::min(static_cast<FX_STRSIZE>(buf.tellp()), + kMaxStringLength)); } parlevel--; buf << ')'; @@ -555,14 +554,14 @@ CFX_ByteString CPDF_StreamParser::ReadString() { if (PositionIsInBounds()) ++m_Pos; - return CFX_ByteString( + return ByteString( buf.str().c_str(), std::min(static_cast<FX_STRSIZE>(buf.tellp()), kMaxStringLength)); } -CFX_ByteString CPDF_StreamParser::ReadHexString() { +ByteString CPDF_StreamParser::ReadHexString() { if (!PositionIsInBounds()) - return CFX_ByteString(); + return ByteString(); std::ostringstream buf; bool bFirst = true; @@ -588,7 +587,7 @@ CFX_ByteString CPDF_StreamParser::ReadHexString() { if (!bFirst) buf << static_cast<char>(code); - return CFX_ByteString( + return ByteString( buf.str().c_str(), std::min(static_cast<FX_STRSIZE>(buf.tellp()), kMaxStringLength)); } |