From 275e260a6cd4a8e506ba974feb85ebcd926c1739 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Mon, 18 Sep 2017 14:23:18 -0400 Subject: 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 Commit-Queue: Ryan Harrison --- core/fpdfapi/parser/cpdf_simple_parser.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'core/fpdfapi/parser/cpdf_simple_parser.cpp') diff --git a/core/fpdfapi/parser/cpdf_simple_parser.cpp b/core/fpdfapi/parser/cpdf_simple_parser.cpp index 650c216e05..d800796d58 100644 --- a/core/fpdfapi/parser/cpdf_simple_parser.cpp +++ b/core/fpdfapi/parser/cpdf_simple_parser.cpp @@ -11,7 +11,7 @@ CPDF_SimpleParser::CPDF_SimpleParser(const uint8_t* pData, uint32_t dwSize) : m_pData(pData), m_dwSize(dwSize), m_dwCurPos(0) {} -CPDF_SimpleParser::CPDF_SimpleParser(const CFX_ByteStringC& str) +CPDF_SimpleParser::CPDF_SimpleParser(const ByteStringView& str) : m_pData(str.raw_str()), m_dwSize(str.GetLength()), m_dwCurPos(0) {} void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart, uint32_t& dwSize) { @@ -91,7 +91,7 @@ void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart, uint32_t& dwSize) { } } -CFX_ByteStringC CPDF_SimpleParser::GetWord() { +ByteStringView CPDF_SimpleParser::GetWord() { const uint8_t* pStart; uint32_t dwSize; ParseWord(pStart, dwSize); @@ -102,8 +102,8 @@ CFX_ByteStringC CPDF_SimpleParser::GetWord() { if (m_dwCurPos < m_dwSize) { m_dwCurPos++; } - return CFX_ByteStringC(pStart, - (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData))); + return ByteStringView(pStart, + (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData))); } if (dwSize == 1 && pStart[0] == '(') { int level = 1; @@ -130,13 +130,13 @@ CFX_ByteStringC CPDF_SimpleParser::GetWord() { if (m_dwCurPos < m_dwSize) { m_dwCurPos++; } - return CFX_ByteStringC(pStart, - (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData))); + return ByteStringView(pStart, + (FX_STRSIZE)(m_dwCurPos - (pStart - m_pData))); } - return CFX_ByteStringC(pStart, dwSize); + return ByteStringView(pStart, dwSize); } -bool CPDF_SimpleParser::FindTagParamFromStart(const CFX_ByteStringC& token, +bool CPDF_SimpleParser::FindTagParamFromStart(const ByteStringView& token, int nParams) { nParams++; uint32_t* pBuf = FX_Alloc(uint32_t, nParams); @@ -152,7 +152,7 @@ bool CPDF_SimpleParser::FindTagParamFromStart(const CFX_ByteStringC& token, if (buf_count > nParams) { buf_count = nParams; } - CFX_ByteStringC word = GetWord(); + ByteStringView word = GetWord(); if (word.IsEmpty()) { FX_Free(pBuf); return false; -- cgit v1.2.3