summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_List.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 11:30:46 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 11:30:47 -0800
commit0d73909e89a5c93917b9cb73fe5c03c484f2793d (patch)
tree6b3dc490bed3fb2e62bb0bc6c09bcf9fb28f0dfc /core/fxcodec/jbig2/JBig2_List.h
parent603f57b85c0643f0598f03b97c4525501f3e1221 (diff)
downloadpdfium-0d73909e89a5c93917b9cb73fe5c03c484f2793d.tar.xz
Remove CJBig2_List in favor of std::vector<std::unique_ptr<>>
Review-Url: https://codereview.chromium.org/2578663002
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_List.h')
-rw-r--r--core/fxcodec/jbig2/JBig2_List.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/core/fxcodec/jbig2/JBig2_List.h b/core/fxcodec/jbig2/JBig2_List.h
deleted file mode 100644
index b021ac3375..0000000000
--- a/core/fxcodec/jbig2/JBig2_List.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef CORE_FXCODEC_JBIG2_JBIG2_LIST_H_
-#define CORE_FXCODEC_JBIG2_JBIG2_LIST_H_
-
-#include <stdlib.h>
-
-#include <vector>
-
-// A poor man's ScopedVector for pointers of TYPE.
-// Owns all the pointers contained within and deletes them on destruction.
-template <class TYPE>
-class CJBig2_List {
- public:
- CJBig2_List() {}
- explicit CJBig2_List(size_t count) { resize(count); }
-
- ~CJBig2_List() { clear(); }
-
- TYPE* get(size_t index) const { return m_vector[index]; }
- TYPE* back() const { return m_vector.back(); }
- size_t size() const { return m_vector.size(); }
-
- // Deletes all the pointers contained within.
- void clear() {
- for (size_t i = 0; i < m_vector.size(); ++i)
- delete m_vector[i];
- m_vector.clear();
- }
-
- // Takes ownership of |pItem|.
- void push_back(TYPE* pItem) { m_vector.push_back(pItem); }
-
- // Takes ownership of |pItem|.
- void set(size_t index, TYPE* pItem) {
- delete m_vector[index];
- m_vector[index] = pItem;
- }
-
- void resize(size_t count) {
- for (size_t i = count; i < size(); ++i)
- delete m_vector[i];
- m_vector.resize(count);
- }
-
- private:
- std::vector<TYPE*> m_vector;
-};
-
-#endif // CORE_FXCODEC_JBIG2_JBIG2_LIST_H_