summaryrefslogtreecommitdiff
path: root/xfa/fgas/crt/ifgas_stream.cpp
AgeCommit message (Collapse)Author
2017-04-18Rename IFGAS_Stream to CFGAS_StreamDan Sinclair
This CL replaces IFGAS_Stream with the only implementation CFGAS_Stream. The CreateReadStream and CreateWriteStream methods are removed in favour of calling MakeRetain directly. Change-Id: I882a89258f642e24fc3d631587db05652bd53ded Reviewed-on: https://pdfium-review.googlesource.com/4210 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-18Remove IFGAS_Stream::CreateWideStringReadStreamDan Sinclair
This Cl removes the wide string read stream and passes through a memory stream as needed. The callers were updated to pass the correct types. Change-Id: I8e2660859a85e38ed1c3f4c596ef7c8242762084 Reviewed-on: https://pdfium-review.googlesource.com/4172 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Fold the CFGAS_Stream subclasses in CFGAS_StreamDan Sinclair
This CL moves ReadData and WriteData into CFGAS_Stream and predicates their usage on m_isWriteStream. This then removes the two subclasses of CFGAS_Stream and just passes the correct flag through the constructor. Change-Id: I72ea88f333c8bdaf5b323b2832479231cfd2c0b8 Reviewed-on: https://pdfium-review.googlesource.com/4154 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Subclass the stream implementations from CFGAS_StreamDan Sinclair
Rename CFGAS_TextStream to CFGAS_Stream. CFGAS_Stream is converted to a base class instead of accepting an IFGAS_StreamImp. Things which inherted from IFGAS_StreamImp now inherit from CFGAS_Stream. The stream type inputs are changed to IFX_SeekableStream so that they can accept the same type (IFX_SeekableStream is an IFX_SeekableWriteStream and an IFX_SeekableReadStream). This way the storage can be shared in the base class. Change-Id: I06645071e68e2a4d4120c0e336529f2c18c2b705 Reviewed-on: https://pdfium-review.googlesource.com/4152 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-18Update IFGAS_Stream::WriteString to take a string.Dan Sinclair
This Cl updates the WriteString method to accept a CFX_WideString. Change-Id: I9f480abf32f4132f8ca33799e673a9e8540285f6 Reviewed-on: https://pdfium-review.googlesource.com/4151 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-13Fold LoadFile{Read|Write} back into constructorsDan Sinclair
The load file methods are always called right after creating the class. This Cl moves their code up into the constructor and then changes the other code to assume that the m_pFile{Read|Write} always exists. Change-Id: I015abf71ea4804d02d4f6f94b97eb1e7855e1fc4 Reviewed-on: https://pdfium-review.googlesource.com/4110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-12Fold CFGAS_Stream into CFGAS_TextStream.Dan Sinclair
Every CFGAS_Stream is wrapped inside a CFGAS_TextStream. This CL folds the two classes together and merges the methods where needed. Change-Id: Ic56449b36baa51254d8d600ce631f285ba2cbb80 Reviewed-on: https://pdfium-review.googlesource.com/4057 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-12Remove params from CFGAS_StreamDan Sinclair
This Cl removes members from CFGAS_Stream which just mirror values that are stored in the stream impl or values which aren't used. Change-Id: Ia2da5a645f4dd3399b3452fd56d833fed341390c Reviewed-on: https://pdfium-review.googlesource.com/4056 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-12Remove text buffer for CFGAS_TextStreamDan Sinclair
The ::ReadString method appears to only be called in the CFDE_XMLSyntaxParser. The reads happen with a buffer size of 32k which seems like we won't have to call this too many times. Change-Id: I3ff522cdb081777b0b0433926392fb1a03455df3 Reviewed-on: https://pdfium-review.googlesource.com/4054 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-12Remove m_iStart which is always zeroDan Sinclair
The m_iStart flag in CFGAS_Stream is always set to 0. This CL removes the variable and cleans up the supporting code. Change-Id: I6f8fa5e97cbcc49802f28f8e1de3eb4792f18183 Reviewed-on: https://pdfium-review.googlesource.com/4053 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-12Fold CXFA_WideTextRead into IFGAS_StreamDan Sinclair
This Cl moves CXFA_WideTextRead to be in the anonymous namespace of IFGAS_Stream and adds a IFGAS_Stream::CreateWideStringReadStream() method. This is done so we have all the implementations of IFGAS_Stream centralized. Change-Id: I9fbbf0a493fc2dd05fcd544e344268214a75d8a1 Reviewed-on: https://pdfium-review.googlesource.com/4052 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-04-12Remove MakeSeekableReadStreamDan Sinclair
This Cl removes the MakeSeekableReadStream call and, at the one place it's used, creates an IFX_MemoryStream which is a seekable read stream. Change-Id: I6b0b23636eff47f8caca5432313ba99703e21e4d Reviewed-on: https://pdfium-review.googlesource.com/4037 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-12Remove the FGAS Buffered StreamDan Sinclair
This CL removes the FGAS buffered stream. The only user was unittests which have been converted to use a ReadStream. Change-Id: I5af9d3bdf570a307502ea01eef6029db1c8fecef Reviewed-on: https://pdfium-review.googlesource.com/4036 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-11Remove the STREAMTYPE define.Dan Sinclair
There are only two types of streams created _File and _Buffer. This CL simplifes the code by removing other stream types and removes code which is for those types. The CFGAS_Stream creation was also inverted to pass in the impl instead of accepting and setting the stream type. Change-Id: I73f207d0f458818ab59db915b256c6fdd633a336 Reviewed-on: https://pdfium-review.googlesource.com/4035 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-11Remove unneeded stream access flagsDan Sinclair
This Cl removes all of the steam access flags other then write. Flags which were always set were removed. Change-Id: I96df4fa0c95d89f4f454db050f3f032bc163e498 Reviewed-on: https://pdfium-review.googlesource.com/4034 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-11Remove unused loading code from IFGAS_StreamDan Sinclair
Remove unused loading methods, fold Create method back into caller. Change-Id: If3b7b3d1cdaf3d58fc7c07c3e96cf9ac89b61bd4 Reviewed-on: https://pdfium-review.googlesource.com/4033 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-11Disabiguate CreateStream callsDan Sinclair
This CL creates a CreateReadStream and CreateWriteStream method instead of having a single overloaded method. This removes the need for the cast at the call sites. The access parameter has been rolled into the method as it was always passed the same way to each Create*Stream method. Change-Id: I845951c3fe386b8051daf4f6b2ee5ba29b5c7d54 Reviewed-on: https://pdfium-review.googlesource.com/4032 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-10Remove unused CreateTextStreamDan Sinclair
This CL removes the CreateTextStream method as it is not called. Change-Id: I628aec2e8f488ad549b3497344ac08c5bb24de51 Reviewed-on: https://pdfium-review.googlesource.com/4014 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
2017-04-10Remove unused CreateSharedStreamDan Sinclair
The CreateShreadStream code is not called, remove. Change-Id: I62871ce190e50598b7c82ab3b43355dbde6b8b4b Reviewed-on: https://pdfium-review.googlesource.com/4013 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from mem methodsDan Sinclair
This Cl drops the FXSYS_ from mem methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I9d5ae905997dbaaec5aa0b2ae4c07358ed9c6236 Reviewed-on: https://pdfium-review.googlesource.com/3613 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-04-03Drop FXSYS_ from file methodsDan Sinclair
This Cl drops the FXSYS_ from file methods which are the same on all platforms. Bug: pdfium:694 Change-Id: I095c64fed69bf70e00a2594fa94a1fdc71a7060e Reviewed-on: https://pdfium-review.googlesource.com/3610 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
2017-03-30Add some calls to MakeUniqueDan Sinclair
This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
2017-03-30Rename fgas_stream to ifgas_streamDan Sinclair
This Cl renames the the fgas_stream files to match the internal ifgas_stream class. The majority of the code in ifgas_stream.cpp is moved into the anonymouse namespace. Change-Id: I0518103d61df077782d9ab26d0ac87485417f379 Reviewed-on: https://pdfium-review.googlesource.com/3370 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>