Loading...
Searching...
No Matches
pdftron::Filters::MemoryFilter Class Reference

`#include <MemoryFilter.h>`

Inheritance diagram for pdftron::Filters::MemoryFilter:

## Public Member Functions
| MemoryFilter (size_t buf_sz, bool is_input)
UChar * | GetBuffer ()
void | SetAsInputFilter ()
Public Member Functions inherited from pdftron::Filters::Filter
| Filter ()
| ~Filter ()
| Filter (const Filter &copy)
Filter & | operator= (const Filter &other)
| operator bool ()
void | AttachFilter (Filter attach_filter)
Filter | ReleaseAttachedFilter ()
Filter | GetAttachedFilter ()
Filter | GetSourceFilter ()
const char * | GetName () const
const char * | GetDecodeName () const
UChar * | Begin ()
size_t | Size ()
void | Consume (size_t num_bytes)
size_t | Count ()
size_t | SetCount (size_t new_count)
void | SetStreamLength (size_t bytes)
void | Flush ()
void | FlushAll ()
bool | IsInputFilter ()
bool | CanSeek ()
void | Seek (ptrdiff_t offset, ReferencePos origin)
ptrdiff_t | Tell ()
size_t | Truncate (size_t new_size)
Filter | CreateInputIterator ()
const UString | GetFilePath () const
void | Destroy ()
void | WriteToFile (const UString &path, bool append)

## Additional Inherited Members
Public Types inherited from pdftron::Filters::Filter
enum | ReferencePos { e_begin = SEEK_SET , e_end = SEEK_END , e_cur = SEEK_CUR }

## Detailed Description

MemoryFilter is a memory buffer that can be used as a source or a sink Filter in the Filter pipeline. When a MemoryFilter is the source, other filters can read data stored in memory; When MemoryFilter is a sink, other filters generate data which is then pushed in a memory buffer owned by MemoryFilter (MemoryFilter makes sure that there is enough space to accommodate all data).

Definition at line 22 of file MemoryFilter.h.

## Constructor & Destructor Documentation

## ◆ MemoryFilter()

pdftron::Filters::MemoryFilter::MemoryFilter | ( | size_t | buf_sz,
|  | bool | is_input )

Constructs a new memory filter with specified buffer size.

Parameters

  is_input | When true, this MemoryFilter acts as a source that other filters can read. When false, it acts as a sink that other filters can write to.

## Member Function Documentation

## ◆ GetBuffer()

UChar * pdftron::Filters::MemoryFilter::GetBuffer | ( |  | ) |

Note
  MemoryFilter specific function.

Returns
  a pointer to the beginning of the buffer. Use method Count() to determine the number of bytes written to or read from MemoryFilter.

## ◆ SetAsInputFilter()

void pdftron::Filters::MemoryFilter::SetAsInputFilter | ( |  | ) |

Note
  MemoryFilter specific function used to change filter mode from output to input. The utility function is useful in cases when and output data buffer should be converted to an input stream.
  The function has no effect on an input MemoryFilter.

The documentation for this class was generated from the following file:

- Filters/MemoryFilter.h