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/page/cpdf_streamcontentparser.h | 29 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h') diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h index a027129c31..c30c6b7d3c 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.h +++ b/core/fpdfapi/page/cpdf_streamcontentparser.h @@ -50,12 +50,12 @@ class CPDF_StreamContentParser { CPDF_AllStates* GetCurStates() const { return m_pCurStates.get(); } bool IsColored() const { return m_bColored; } const float* GetType3Data() const { return m_Type3Data; } - CPDF_Font* FindFont(const CFX_ByteString& name); + CPDF_Font* FindFont(const ByteString& name); - static CFX_ByteStringC FindKeyAbbreviationForTesting( - const CFX_ByteStringC& abbr); - static CFX_ByteStringC FindValueAbbreviationForTesting( - const CFX_ByteStringC& abbr); + static ByteStringView FindKeyAbbreviationForTesting( + const ByteStringView& abbr); + static ByteStringView FindValueAbbreviationForTesting( + const ByteStringView& abbr); private: struct ContentParam { @@ -84,17 +84,17 @@ class CPDF_StreamContentParser { using OpCodes = std::map; static OpCodes InitializeOpCodes(); - void AddNameParam(const CFX_ByteStringC& str); - void AddNumberParam(const CFX_ByteStringC& str); + void AddNameParam(const ByteStringView& str); + void AddNumberParam(const ByteStringView& str); void AddObjectParam(std::unique_ptr pObj); int GetNextParamPos(); void ClearAllParams(); CPDF_Object* GetObject(uint32_t index); - CFX_ByteString GetString(uint32_t index); + ByteString GetString(uint32_t index); float GetNumber(uint32_t index); int GetInteger(uint32_t index) { return (int32_t)(GetNumber(index)); } - void OnOperator(const CFX_ByteStringC& op); - void AddTextObject(CFX_ByteString* pText, + void OnOperator(const ByteStringView& op); + void AddTextObject(ByteString* pText, float fInitKerning, float* pKerning, int count); @@ -113,10 +113,9 @@ class CPDF_StreamContentParser { bool bColor, bool bText, bool bGraph); - CPDF_ColorSpace* FindColorSpace(const CFX_ByteString& name); - CPDF_Pattern* FindPattern(const CFX_ByteString& name, bool bShading); - CPDF_Object* FindResourceObj(const CFX_ByteString& type, - const CFX_ByteString& name); + CPDF_ColorSpace* FindColorSpace(const ByteString& name); + CPDF_Pattern* FindPattern(const ByteString& name, bool bShading); + CPDF_Object* FindResourceObj(const ByteString& type, const ByteString& name); // Takes ownership of |pImageObj|, returns unowned pointer to it. CPDF_ImageObject* AddImageObject(std::unique_ptr pImageObj); @@ -217,7 +216,7 @@ class CPDF_StreamContentParser { float m_PathCurrentX; float m_PathCurrentY; uint8_t m_PathClipType; - CFX_ByteString m_LastImageName; + ByteString m_LastImageName; CFX_RetainPtr m_pLastImage; bool m_bColored; float m_Type3Data[6]; -- cgit v1.2.3