summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_basic.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2017-01-06 10:29:49 -0800
committerCommit bot <commit-bot@chromium.org>2017-01-06 10:29:49 -0800
commit591ed144f8dfe4b2915f01f1cc725f584d498a3f (patch)
treef08cf7fe476888216f696bec84023ad34b8a7cfe /core/fxcrt/fx_basic.h
parent6fd07ef0a817dca5acbcadea41b8f880376f339a (diff)
downloadpdfium-591ed144f8dfe4b2915f01f1cc725f584d498a3f.tar.xz
Remove CFX_MapPtrToPtr and templates.chromium/2976chromium/2975
All usage is now replaced with stl equivalents. Move one definition from fx_basic.h to where it's actually needed. Review-Url: https://codereview.chromium.org/2612773007
Diffstat (limited to 'core/fxcrt/fx_basic.h')
-rw-r--r--core/fxcrt/fx_basic.h102
1 files changed, 0 insertions, 102 deletions
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h
index 3b09489d71..5adcf701c5 100644
--- a/core/fxcrt/fx_basic.h
+++ b/core/fxcrt/fx_basic.h
@@ -335,108 +335,6 @@ class CFX_FixedBufGrow {
std::unique_ptr<DataType, FxFreeDeleter> m_pGrowData;
};
-#ifdef PDF_ENABLE_XFA
-class CFX_MapPtrToPtr {
- protected:
- struct CAssoc {
- CAssoc* pNext;
- void* key;
- void* value;
- };
-
- public:
- explicit CFX_MapPtrToPtr(int nBlockSize = 10);
- ~CFX_MapPtrToPtr();
-
- int GetCount() const { return m_nCount; }
- bool IsEmpty() const { return m_nCount == 0; }
-
- bool Lookup(void* key, void*& rValue) const;
-
- void* GetValueAt(void* key) const;
-
- void*& operator[](void* key);
-
- void SetAt(void* key, void* newValue) { (*this)[key] = newValue; }
-
- bool RemoveKey(void* key);
-
- void RemoveAll();
-
- FX_POSITION GetStartPosition() const {
- return m_nCount == 0 ? nullptr : (FX_POSITION)-1;
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition,
- void*& rKey,
- void*& rValue) const;
-
- uint32_t GetHashTableSize() const { return m_nHashTableSize; }
-
- void InitHashTable(uint32_t hashSize, bool bAllocNow = true);
-
- protected:
- CAssoc** m_pHashTable;
-
- uint32_t m_nHashTableSize;
-
- int m_nCount;
-
- CAssoc* m_pFreeList;
-
- struct CFX_Plex* m_pBlocks;
-
- int m_nBlockSize;
-
- uint32_t HashKey(void* key) const;
-
- CAssoc* NewAssoc();
-
- void FreeAssoc(CAssoc* pAssoc);
-
- CAssoc* GetAssocAt(void* key, uint32_t& hash) const;
-};
-
-template <class KeyType, class ValueType>
-class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
- public:
- CFX_MapPtrTemplate() : CFX_MapPtrToPtr(10) {}
-
- bool Lookup(KeyType key, ValueType& rValue) const {
- void* pValue = nullptr;
- if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) {
- return false;
- }
- rValue = (ValueType)(uintptr_t)pValue;
- return true;
- }
-
- ValueType& operator[](KeyType key) {
- return (ValueType&)CFX_MapPtrToPtr::operator[]((void*)(uintptr_t)key);
- }
-
- void SetAt(KeyType key, ValueType newValue) {
- CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue);
- }
-
- bool RemoveKey(KeyType key) {
- return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key);
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition,
- KeyType& rKey,
- ValueType& rValue) const {
- void* pKey = nullptr;
- void* pValue = nullptr;
- CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
- rKey = (KeyType)(uintptr_t)pKey;
- rValue = (ValueType)(uintptr_t)pValue;
- }
-};
-
-typedef void (*PD_CALLBACK_FREEDATA)(void* pData);
-#endif // PDF_ENABLE_XFA
-
class CFX_BitStream {
public:
void Init(const uint8_t* pData, uint32_t dwSize);