Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cfx_memorystream.h
Go to the documentation of this file.
1// Copyright 2017 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_FXCRT_CFX_MEMORYSTREAM_H_
8#define CORE_FXCRT_CFX_MEMORYSTREAM_H_
9
10#include "core/fxcrt/data_vector.h"
11#include "core/fxcrt/fx_stream.h"
12#include "core/fxcrt/retain_ptr.h"
13#include "core/fxcrt/span.h"
14
15class CFX_MemoryStream final : public IFX_SeekableStream {
16 public:
18
19 // IFX_SeekableStream
20 FX_FILESIZE GetSize() override;
21 FX_FILESIZE GetPosition() override;
22 bool IsEOF() override;
23 bool ReadBlockAtOffset(pdfium::span<uint8_t> buffer,
24 FX_FILESIZE offset) override;
25 bool WriteBlock(pdfium::span<const uint8_t> buffer) override;
26 bool Flush() override;
27
28 pdfium::span<const uint8_t> GetSpan() const;
29
30 private:
31 CFX_MemoryStream();
32 ~CFX_MemoryStream() override;
33
34 DataVector<uint8_t> m_data;
35 size_t m_nCurSize = 0;
36 size_t m_nCurPos = 0;
37};
38
39#endif // CORE_FXCRT_CFX_MEMORYSTREAM_H_
#define DCHECK
Definition check.h:33
FX_FILESIZE GetPosition() override
bool IsEOF() override
~CFX_MemoryStream() override
bool ReadBlockAtOffset(pdfium::span< uint8_t > buffer, FX_FILESIZE offset) override
FX_FILESIZE GetSize() override
bool WriteBlock(pdfium::span< const uint8_t > buffer) override
bool Flush() override
pdfium::span< const uint8_t > GetSpan() const
std::map< ByteString, RetainPtr< CPDF_Object >, std::less<> > DictMap
ByteString GetNameFor(const ByteString &key) const
bool WriteDictTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const
RetainPtr< const CPDF_Dictionary > GetDict() const
uint32_t m_ObjNum
static constexpr uint32_t kInvalidObjNum
Definition cpdf_object.h:52
RetainPtr< CPDF_Object > CloneObjectNonCyclic(bool bDirect) const
bool HasFilter() const
RetainPtr< CPDF_Object > Clone() const override
~CPDF_Stream() override
size_t GetRawSize() const
CPDF_Stream * AsMutableStream() override
bool WriteTo(IFX_ArchiveStream *archive, const CPDF_Encryptor *encryptor) const override
bool IsFileBased() const
Definition cpdf_stream.h:59
void SetDataFromStringstreamAndRemoveFilter(fxcrt::ostringstream *stream)
Type GetType() const override
void SetDataAndRemoveFilter(pdfium::span< const uint8_t > pData)
void SetDataFromStringstream(fxcrt::ostringstream *stream)
DataVector< uint8_t > ReadAllRawData() const
void SetData(pdfium::span< const uint8_t > pData)
pdfium::span< const uint8_t > GetInMemoryRawData() const
RetainPtr< CPDF_Object > CloneNonCyclic(bool bDirect, std::set< const CPDF_Object * > *pVisited) const override
WideString GetUnicodeText() const override
const CPDF_Dictionary * GetDictInternal() const override
void InitStreamFromFile(RetainPtr< IFX_SeekableReadStream > file)
bool WriteString(ByteStringView str)
Definition fx_stream.cpp:46
bool operator==(const char *ptr) const
#define FX_FILESIZE
Definition fx_types.h:19
#define CHECK(cvref)
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:222
fxcrt::WideString WideString
Definition widestring.h:207