summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_dictionary.h
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /core/fpdfapi/parser/cpdf_dictionary.h
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-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/parser/cpdf_dictionary.h')
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.h67
1 files changed, 32 insertions, 35 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.h b/core/fpdfapi/parser/cpdf_dictionary.h
index 31a09d954d..93c00c8c10 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.h
+++ b/core/fpdfapi/parser/cpdf_dictionary.h
@@ -24,10 +24,10 @@ class CPDF_IndirectObjectHolder;
class CPDF_Dictionary : public CPDF_Object {
public:
using const_iterator =
- std::map<CFX_ByteString, std::unique_ptr<CPDF_Object>>::const_iterator;
+ std::map<ByteString, std::unique_ptr<CPDF_Object>>::const_iterator;
CPDF_Dictionary();
- explicit CPDF_Dictionary(const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
+ explicit CPDF_Dictionary(const CFX_WeakPtr<ByteStringPool>& pPool);
~CPDF_Dictionary() override;
// CPDF_Object:
@@ -40,76 +40,73 @@ class CPDF_Dictionary : public CPDF_Object {
bool WriteTo(IFX_ArchiveStream* archive) const override;
size_t GetCount() const { return m_Map.size(); }
- CPDF_Object* GetObjectFor(const CFX_ByteString& key) const;
- CPDF_Object* GetDirectObjectFor(const CFX_ByteString& key) const;
- CFX_ByteString GetStringFor(const CFX_ByteString& key) const;
- CFX_ByteString GetStringFor(const CFX_ByteString& key,
- const CFX_ByteString& default_str) const;
- CFX_WideString GetUnicodeTextFor(const CFX_ByteString& key) const;
- int GetIntegerFor(const CFX_ByteString& key) const;
- int GetIntegerFor(const CFX_ByteString& key, int default_int) const;
- bool GetBooleanFor(const CFX_ByteString& key, bool bDefault = false) const;
- float GetNumberFor(const CFX_ByteString& key) const;
- CPDF_Dictionary* GetDictFor(const CFX_ByteString& key) const;
- CPDF_Stream* GetStreamFor(const CFX_ByteString& key) const;
- CPDF_Array* GetArrayFor(const CFX_ByteString& key) const;
- CFX_FloatRect GetRectFor(const CFX_ByteString& key) const;
- CFX_Matrix GetMatrixFor(const CFX_ByteString& key) const;
- float GetFloatFor(const CFX_ByteString& key) const {
- return GetNumberFor(key);
- }
-
- bool KeyExist(const CFX_ByteString& key) const;
+ CPDF_Object* GetObjectFor(const ByteString& key) const;
+ CPDF_Object* GetDirectObjectFor(const ByteString& key) const;
+ ByteString GetStringFor(const ByteString& key) const;
+ ByteString GetStringFor(const ByteString& key,
+ const ByteString& default_str) const;
+ WideString GetUnicodeTextFor(const ByteString& key) const;
+ int GetIntegerFor(const ByteString& key) const;
+ int GetIntegerFor(const ByteString& key, int default_int) const;
+ bool GetBooleanFor(const ByteString& key, bool bDefault = false) const;
+ float GetNumberFor(const ByteString& key) const;
+ CPDF_Dictionary* GetDictFor(const ByteString& key) const;
+ CPDF_Stream* GetStreamFor(const ByteString& key) const;
+ CPDF_Array* GetArrayFor(const ByteString& key) const;
+ CFX_FloatRect GetRectFor(const ByteString& key) const;
+ CFX_Matrix GetMatrixFor(const ByteString& key) const;
+ float GetFloatFor(const ByteString& key) const { return GetNumberFor(key); }
+
+ bool KeyExist(const ByteString& key) const;
bool IsSignatureDict() const;
// Set* functions invalidate iterators for the element with the key |key|.
// Takes ownership of |pObj|, returns an unowned pointer to it.
- CPDF_Object* SetFor(const CFX_ByteString& key,
- std::unique_ptr<CPDF_Object> pObj);
+ CPDF_Object* SetFor(const ByteString& key, std::unique_ptr<CPDF_Object> pObj);
// Creates a new object owned by the dictionary and returns an unowned
// pointer to it.
template <typename T, typename... Args>
typename std::enable_if<!CanInternStrings<T>::value, T*>::type SetNewFor(
- const CFX_ByteString& key,
+ const ByteString& key,
Args&&... args) {
return static_cast<T*>(
SetFor(key, pdfium::MakeUnique<T>(std::forward<Args>(args)...)));
}
template <typename T, typename... Args>
typename std::enable_if<CanInternStrings<T>::value, T*>::type SetNewFor(
- const CFX_ByteString& key,
+ const ByteString& key,
Args&&... args) {
return static_cast<T*>(SetFor(
key, pdfium::MakeUnique<T>(m_pPool, std::forward<Args>(args)...)));
}
// Convenience functions to convert native objects to array form.
- void SetRectFor(const CFX_ByteString& key, const CFX_FloatRect& rect);
- void SetMatrixFor(const CFX_ByteString& key, const CFX_Matrix& matrix);
+ void SetRectFor(const ByteString& key, const CFX_FloatRect& rect);
+ void SetMatrixFor(const ByteString& key, const CFX_Matrix& matrix);
- void ConvertToIndirectObjectFor(const CFX_ByteString& key,
+ void ConvertToIndirectObjectFor(const ByteString& key,
CPDF_IndirectObjectHolder* pHolder);
// Invalidates iterators for the element with the key |key|.
- std::unique_ptr<CPDF_Object> RemoveFor(const CFX_ByteString& key);
+ std::unique_ptr<CPDF_Object> RemoveFor(const ByteString& key);
// Invalidates iterators for the element with the key |oldkey|.
- void ReplaceKey(const CFX_ByteString& oldkey, const CFX_ByteString& newkey);
+ void ReplaceKey(const ByteString& oldkey, const ByteString& newkey);
const_iterator begin() const { return m_Map.begin(); }
const_iterator end() const { return m_Map.end(); }
- CFX_WeakPtr<CFX_ByteStringPool> GetByteStringPool() const { return m_pPool; }
+ CFX_WeakPtr<ByteStringPool> GetByteStringPool() const { return m_pPool; }
protected:
- CFX_ByteString MaybeIntern(const CFX_ByteString& str);
+ ByteString MaybeIntern(const ByteString& str);
std::unique_ptr<CPDF_Object> CloneNonCyclic(
bool bDirect,
std::set<const CPDF_Object*>* visited) const override;
- CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
- std::map<CFX_ByteString, std::unique_ptr<CPDF_Object>> m_Map;
+ CFX_WeakPtr<ByteStringPool> m_pPool;
+ std::map<ByteString, std::unique_ptr<CPDF_Object>> m_Map;
};
inline CPDF_Dictionary* ToDictionary(CPDF_Object* obj) {