summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/fgas_utils.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-03-02 13:06:14 -0800
committerChromium commit bot <commit-bot@chromium.org>2017-03-02 21:29:37 +0000
commit281a51d6d4c13dd6fc479d8e01fa964cb148272c (patch)
tree4f972ee0b220c065e03853c70a99be389b20638d /xfa/fgas/crt/fgas_utils.h
parentc803cbcad51355ffa38dce0851a51dfdcf279645 (diff)
downloadpdfium-281a51d6d4c13dd6fc479d8e01fa964cb148272c.tar.xz
Remove CFX_MassArrayTemplate
CFX_BaseMassArrayImp is still used under the covers; leave it for now. Change-Id: Iad8bec13243b92c36e9d13130b89fd61a7e63436 Reviewed-on: https://pdfium-review.googlesource.com/2902 Commit-Queue: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/crt/fgas_utils.h')
-rw-r--r--xfa/fgas/crt/fgas_utils.h146
1 files changed, 0 insertions, 146 deletions
diff --git a/xfa/fgas/crt/fgas_utils.h b/xfa/fgas/crt/fgas_utils.h
index 465601149b..18bc6fcd6e 100644
--- a/xfa/fgas/crt/fgas_utils.h
+++ b/xfa/fgas/crt/fgas_utils.h
@@ -104,152 +104,6 @@ class CFX_BaseMassArrayImp {
int32_t iSrcCount);
};
-class CFX_BaseMassArray {
- protected:
- CFX_BaseMassArray(int32_t iChunkSize, int32_t iBlockSize);
- ~CFX_BaseMassArray();
-
- int32_t GetSize() const;
- uint8_t* AddSpaceTo(int32_t index);
- uint8_t* GetAt(int32_t index) const;
- int32_t Append(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount);
- int32_t Copy(const CFX_BaseMassArray& src, int32_t iStart, int32_t iCount);
- int32_t RemoveLast(int32_t iCount);
- void RemoveAll(bool bLeaveMemory);
- CFX_BaseMassArrayImp* m_pData;
-};
-
-template <class baseType>
-class CFX_MassArrayTemplate : public CFX_BaseMassArray {
- public:
- explicit CFX_MassArrayTemplate(int32_t iChunkSize)
- : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
- CFX_MassArrayTemplate(int32_t iChunkSize, int32_t iBlockSize)
- : CFX_BaseMassArray(iChunkSize, iBlockSize) {}
-
- int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); }
- baseType* AddSpace() {
- return (baseType*)CFX_BaseMassArray::AddSpaceTo(
- CFX_BaseMassArray::GetSize());
- }
- int32_t Add(const baseType& element) {
- int32_t index = CFX_BaseMassArray::GetSize();
- *(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
- return index;
- }
- baseType& GetAt(int32_t index) const {
- return *(baseType*)CFX_BaseMassArray::GetAt(index);
- }
- baseType* GetPtrAt(int32_t index) const {
- return (baseType*)CFX_BaseMassArray::GetAt(index);
- }
- void SetAt(int32_t index, const baseType& element) {
- *(baseType*)CFX_BaseMassArray::GetAt(index) = element;
- }
- void SetAtGrow(int32_t index, const baseType& element) {
- *(baseType*)CFX_BaseMassArray::AddSpaceTo(index) = element;
- }
- int32_t Append(const CFX_MassArrayTemplate& src,
- int32_t iStart,
- int32_t iCount) {
- return CFX_BaseMassArray::Append(src, iStart, iCount);
- }
- int32_t Copy(const CFX_MassArrayTemplate& src,
- int32_t iStart,
- int32_t iCount) {
- return CFX_BaseMassArray::Copy(src, iStart, iCount);
- }
- int32_t RemoveLast(int32_t iCount) {
- return CFX_BaseMassArray::RemoveLast(iCount);
- }
- void RemoveAll(bool bLeaveMemory) {
- CFX_BaseMassArray::RemoveAll(bLeaveMemory);
- }
-};
-
-template <class baseType>
-class CFX_ObjectMassArrayTemplate : public CFX_BaseMassArray {
- public:
- explicit CFX_ObjectMassArrayTemplate(int32_t iChunkSize)
- : CFX_BaseMassArray(iChunkSize, sizeof(baseType)) {}
- ~CFX_ObjectMassArrayTemplate() { RemoveAll(false); }
-
- int32_t GetSize() const { return CFX_BaseMassArray::GetSize(); }
- int32_t Add(const baseType& element) {
- int32_t index = CFX_BaseMassArray::GetSize();
- baseType* p = (baseType*)CFX_BaseMassArray::AddSpaceTo(index);
- new ((void*)p) baseType(element);
- return index;
- }
- baseType& GetAt(int32_t index) const {
- return *(baseType*)CFX_BaseMassArray::GetAt(index);
- }
- baseType* GetPtrAt(int32_t index) const {
- return (baseType*)CFX_BaseMassArray::GetAt(index);
- }
- int32_t Append(const CFX_ObjectMassArrayTemplate& src,
- int32_t iStart,
- int32_t iCount) {
- if (iCount == 0) {
- return CFX_BaseMassArray::GetSize();
- }
- int32_t iSize = src.GetSize();
- ASSERT(iStart > -1 && iStart < iSize);
- if (iCount < 0) {
- iCount = iSize;
- }
- int32_t iEnd = iStart + iCount;
- if (iEnd > iSize) {
- iEnd = iSize;
- }
- for (int32_t i = iStart; i < iEnd; i++) {
- Add(src.GetAt(i));
- }
- return CFX_BaseMassArray::GetSize();
- }
- int32_t Copy(const CFX_ObjectMassArrayTemplate& src,
- int32_t iStart,
- int32_t iCount) {
- if (iCount == 0) {
- return CFX_BaseMassArray::GetSize();
- }
- int32_t iSize = src.GetSize();
- ASSERT(iStart > -1 && iStart < iSize);
- if (iCount < 0) {
- iCount = iSize;
- }
- int32_t iEnd = iStart + iCount;
- if (iEnd > iSize) {
- iEnd = iSize;
- }
- RemoveAll(true);
- for (int32_t i = iStart; i < iEnd; i++) {
- Add(src.GetAt(i));
- }
- return CFX_BaseMassArray::GetSize();
- }
- int32_t RemoveLast(int32_t iCount) {
- int32_t iSize = CFX_BaseMassArray::GetSize();
- if (iCount < 0 || iCount > iSize) {
- iCount = iSize;
- }
- if (iCount == 0) {
- return iSize;
- }
- for (int32_t i = iSize - iCount; i < iSize; i++) {
- ((baseType*)GetPtrAt(i))->~baseType();
- }
- return CFX_BaseMassArray::RemoveLast(iCount);
- }
- void RemoveAll(bool bLeaveMemory) {
- int32_t iSize = CFX_BaseMassArray::GetSize();
- for (int32_t i = 0; i < iSize; i++) {
- ((baseType*)GetPtrAt(i))->~baseType();
- }
- CFX_BaseMassArray::RemoveAll(bLeaveMemory);
- }
-};
-
class CFX_BaseDiscreteArray {
protected:
CFX_BaseDiscreteArray(int32_t iChunkSize, int32_t iBlockSize);