1 // Copyright 2016 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 // 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef CORE_FXCODEC_JBIG2_JBIG2_DOCUMENTCONTEXT_H_ 8 #define CORE_FXCODEC_JBIG2_JBIG2_DOCUMENTCONTEXT_H_ 9 10 #include <list> 11 #include <memory> 12 #include <utility> 13 14 class CJBig2_SymbolDict; 15 16 // Cache is keyed by both the key of a stream and an index within the stream. 17 using CJBig2_CompoundKey = std::pair<uint64_t, uint32_t>; 18 using CJBig2_CachePair = 19 std::pair<CJBig2_CompoundKey, std::unique_ptr<CJBig2_SymbolDict>>; 20 21 // Holds per-document JBig2 related data. 22 class JBig2_DocumentContext { 23 public: 24 JBig2_DocumentContext(); 25 ~JBig2_DocumentContext(); 26 GetSymbolDictCache()27 std::list<CJBig2_CachePair>* GetSymbolDictCache() { 28 return &m_SymbolDictCache; 29 } 30 31 private: 32 std::list<CJBig2_CachePair> m_SymbolDictCache; 33 }; 34 35 #endif // CORE_FXCODEC_JBIG2_JBIG2_DOCUMENTCONTEXT_H_ 36