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/fxcrt/xml/cxml_element.h | |
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/fxcrt/xml/cxml_element.h')
-rw-r--r-- | core/fxcrt/xml/cxml_element.h | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/core/fxcrt/xml/cxml_element.h b/core/fxcrt/xml/cxml_element.h index a4b4b14129..91ac731021 100644 --- a/core/fxcrt/xml/cxml_element.h +++ b/core/fxcrt/xml/cxml_element.h @@ -18,85 +18,84 @@ class CXML_Element : public CXML_Object { static std::unique_ptr<CXML_Element> Parse(const void* pBuffer, size_t size); CXML_Element(const CXML_Element* pParent, - const CFX_ByteStringC& qSpace, - const CFX_ByteStringC& tagname); + const ByteStringView& qSpace, + const ByteStringView& tagname); ~CXML_Element() override; // CXML_Object: CXML_Element* AsElement() override; const CXML_Element* AsElement() const override; - CFX_ByteString GetTagName(bool bQualified = false) const; - CFX_ByteString GetNamespace(bool bQualified = false) const; - CFX_ByteString GetNamespaceURI(const CFX_ByteString& qName) const; + ByteString GetTagName(bool bQualified = false) const; + ByteString GetNamespace(bool bQualified = false) const; + ByteString GetNamespaceURI(const ByteString& qName) const; const CXML_Element* GetParent() const { return m_pParent.Get(); } uint32_t CountAttrs() const { return m_AttrMap.GetSize(); } void GetAttrByIndex(int index, - CFX_ByteString* space, - CFX_ByteString* name, - CFX_WideString* value) const; - bool HasAttr(const CFX_ByteStringC& qName) const; - bool GetAttrValue(const CFX_ByteStringC& name, - CFX_WideString& attribute) const; - CFX_WideString GetAttrValue(const CFX_ByteStringC& name) const { - CFX_WideString attr; + ByteString* space, + ByteString* name, + WideString* value) const; + bool HasAttr(const ByteStringView& qName) const; + bool GetAttrValue(const ByteStringView& name, WideString& attribute) const; + WideString GetAttrValue(const ByteStringView& name) const { + WideString attr; GetAttrValue(name, attr); return attr; } - bool GetAttrValue(const CFX_ByteStringC& space, - const CFX_ByteStringC& name, - CFX_WideString& attribute) const; - CFX_WideString GetAttrValue(const CFX_ByteStringC& space, - const CFX_ByteStringC& name) const { - CFX_WideString attr; + bool GetAttrValue(const ByteStringView& space, + const ByteStringView& name, + WideString& attribute) const; + WideString GetAttrValue(const ByteStringView& space, + const ByteStringView& name) const { + WideString attr; GetAttrValue(space, name, attr); return attr; } - bool GetAttrInteger(const CFX_ByteStringC& name, int& attribute) const; - int GetAttrInteger(const CFX_ByteStringC& name) const { + bool GetAttrInteger(const ByteStringView& name, int& attribute) const; + int GetAttrInteger(const ByteStringView& name) const { int attr = 0; GetAttrInteger(name, attr); return attr; } - bool GetAttrInteger(const CFX_ByteStringC& space, - const CFX_ByteStringC& name, + bool GetAttrInteger(const ByteStringView& space, + const ByteStringView& name, int& attribute) const; - int GetAttrInteger(const CFX_ByteStringC& space, - const CFX_ByteStringC& name) const { + int GetAttrInteger(const ByteStringView& space, + const ByteStringView& name) const { int attr = 0; GetAttrInteger(space, name, attr); return attr; } - bool GetAttrFloat(const CFX_ByteStringC& name, float& attribute) const; - float GetAttrFloat(const CFX_ByteStringC& name) const { + bool GetAttrFloat(const ByteStringView& name, float& attribute) const; + float GetAttrFloat(const ByteStringView& name) const { float attr = 0; GetAttrFloat(name, attr); return attr; } - bool GetAttrFloat(const CFX_ByteStringC& space, - const CFX_ByteStringC& name, + bool GetAttrFloat(const ByteStringView& space, + const ByteStringView& name, float& attribute) const; - float GetAttrFloat(const CFX_ByteStringC& space, - const CFX_ByteStringC& name) const { + float GetAttrFloat(const ByteStringView& space, + const ByteStringView& name) const { float attr = 0; GetAttrFloat(space, name, attr); return attr; } uint32_t CountChildren() const { return m_Children.size(); } - uint32_t CountElements(const CFX_ByteStringC& space, - const CFX_ByteStringC& tag) const; + uint32_t CountElements(const ByteStringView& space, + const ByteStringView& tag) const; CXML_Object* GetChild(uint32_t index) const; - CXML_Element* GetElement(const CFX_ByteStringC& space, - const CFX_ByteStringC& tag, + CXML_Element* GetElement(const ByteStringView& space, + const ByteStringView& tag, int nth) const; uint32_t FindElement(CXML_Element* pElement) const; - void SetTag(const CFX_ByteStringC& qTagName); + void SetTag(const ByteStringView& qTagName); void RemoveChild(uint32_t index); private: @@ -104,8 +103,8 @@ class CXML_Element : public CXML_Object { friend class CXML_Composer; CFX_UnownedPtr<const CXML_Element> const m_pParent; - CFX_ByteString m_QSpaceName; - CFX_ByteString m_TagName; + ByteString m_QSpaceName; + ByteString m_TagName; CXML_AttrMap m_AttrMap; std::vector<std::unique_ptr<CXML_Object>> m_Children; }; |