Ipelib: ipe::Buffer Class Reference

Ipelib

Classes | Public Member Functions | List of all members
ipe::Buffer Class Reference
Ipe Base

`#include <ipebase.h>`

## Public Member Functions
| Buffer () noexcept=default
| ~Buffer () noexcept
| Buffer (const Buffer &rhs) noexcept
| Buffer (Buffer &&rhs) noexcept
Buffer & | operator= (const Buffer &rhs) noexcept
Buffer & | operator= (Buffer &&rhs) noexcept
| Buffer (int size) noexcept
| Buffer (const char *data, int size) noexcept
char & | operator[] (int index) noexcept
const char & | operator[] (int index) const noexcept
int | size () const noexcept
char * | data () noexcept
const char * | data () const noexcept

## Detailed Description

A memory buffer.

Implements sharing semantics using reference counting.

## Constructor & Destructor Documentation

## ◆ Buffer() [1/5]

ipe::Buffer::Buffer | ( |  | ) |
| defaultnoexcept

Referenced by ipe::Lex::skipWhitespace().

## ◆ ~Buffer()

Buffer::~Buffer | ( |  | ) |
| noexcept

Destructor.

## ◆ Buffer() [2/5]

Buffer::Buffer | ( | const Buffer & | rhs | ) |
| noexcept

Copy constructor. Constant time, buffer is shared.

## ◆ Buffer() [3/5]

Buffer::Buffer | ( | Buffer && | rhs | ) |
| noexcept

Move constructor. Constant time.

## ◆ Buffer() [4/5]

Buffer::Buffer | ( | int | size | ) |
| explicitnoexcept

Create buffer of specified size.

## ◆ Buffer() [5/5]

Buffer::Buffer | ( | const char * | data,
|  | int | size
| ) |  |
| explicitnoexcept

Create buffer by copying the data.

References ipe::String::data(), and ipe::String::size().

## Member Function Documentation

## ◆ operator=() [1/2]

Buffer & Buffer::operator= | ( | const Buffer & | rhs | ) |
| noexcept

Assignment operator (constant-time).

## ◆ operator=() [2/2]

Buffer & Buffer::operator= | ( | Buffer && | rhs | ) |
| noexcept

Assignment move operator (constant-time).

## ◆ operator[]() [1/2]

char& ipe::Buffer::operator[] | ( | int | index | ) |
| inlinenoexcept

Character access.

## ◆ operator[]() [2/2]

const char& ipe::Buffer::operator[] | ( | int | index | ) | const
| inlinenoexcept

Character access (const version).

## ◆ size()

int ipe::Buffer::size | ( |  | ) | const
| inlinenoexcept

Return size of buffer;.

Referenced by ipe::Bitmap::Bitmap(), ipe::DeflateStream::close(), ipe::CairoPainter::doDrawBitmap(), ipe::Face::Face(), ipe::Document::formatFromFilename(), ipe::InflateSource::getChar(), ipe::BufferSource::getChar(), ipe::Face::glyphIndex(), ipe::Bitmap::pixelData(), ipe::DeflateStream::putChar(), ipe::PdfDict::write(), ipe::InflateSource::~InflateSource(), and ipe::PdfWriter::~PdfWriter().

## ◆ data() [1/2]

char* ipe::Buffer::data | ( |  | ) |
| inlinenoexcept

Return pointer to buffer data.

Referenced by ipe::Bitmap::Bitmap(), ipe::DeflateStream::close(), ipe::DeflateStream::deflate(), ipe::CairoPainter::doDrawBitmap(), ipe::Face::Face(), ipe::Document::formatFromFilename(), ipe::InflateSource::getChar(), ipe::Face::glyphIndex(), ipe::InflateSource::InflateSource(), ipe::PageSelector::PageSelector(), ipe::Bitmap::pixelData(), ipe::DeflateStream::putChar(), ipe::Bitmap::readPNG(), ipe::Thumbnail::render(), ipe::InflateSource::~InflateSource(), and ipe::PdfWriter::~PdfWriter().

## ◆ data() [2/2]

const char* ipe::Buffer::data | ( |  | ) | const
| inlinenoexcept

Return pointer to buffer data (const version).

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

- ipebase.h
- ipebase.cpp