Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2649)

Unified Diff: core/src/fxcodec/jbig2/JBig2_List.h

Issue 1800523005: Move core/src/ up to core/. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_Image.cpp ('k') | core/src/fxcodec/jbig2/JBig2_Page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_List.h
diff --git a/core/src/fxcodec/jbig2/JBig2_List.h b/core/src/fxcodec/jbig2/JBig2_List.h
deleted file mode 100644
index 6f6169064da12aa5603b42045732ba1cd85e3a7c..0000000000000000000000000000000000000000
--- a/core/src/fxcodec/jbig2/JBig2_List.h
+++ /dev/null
@@ -1,56 +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_SRC_FXCODEC_JBIG2_JBIG2_LIST_H_
-#define CORE_SRC_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_SRC_FXCODEC_JBIG2_JBIG2_LIST_H_
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_Image.cpp ('k') | core/src/fxcodec/jbig2/JBig2_Page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698