Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
SkPDFArray Class Reference

#include <SkPDFTypes.h>

Inheritance diagram for SkPDFArray:
SkPDFObject

Public Member Functions

 SkPDFArray ()
 
 ~SkPDFArray () override
 
void emitObject (SkWStream *stream) const override
 
size_t size () const
 
void reserve (int length)
 
void appendInt (int32_t)
 
void appendColorComponent (uint8_t)
 
void appendBool (bool)
 
void appendScalar (SkScalar)
 
void appendName (const char[])
 
void appendName (SkString)
 
void appendByteString (const char[])
 
void appendTextString (const char[])
 
void appendByteString (SkString)
 
void appendTextString (SkString)
 
void appendObject (std::unique_ptr< SkPDFObject > &&)
 
void appendRef (SkPDFIndirectReference)
 
- Public Member Functions inherited from SkPDFObject
 SkPDFObject ()=default
 
virtual ~SkPDFObject ()=default
 

Detailed Description

An array object in a PDF.

Definition at line 12 of file SkDocument_PDF_None.cpp.

Constructor & Destructor Documentation

◆ SkPDFArray()

SkPDFArray::SkPDFArray ( )

Create a PDF array. Maximum length is 8191.

Definition at line 367 of file SkPDFTypes.cpp.

367{}

◆ ~SkPDFArray()

SkPDFArray::~SkPDFArray ( )
override

Definition at line 369 of file SkPDFTypes.cpp.

369{}

Member Function Documentation

◆ appendBool()

void SkPDFArray::appendBool ( bool  value)

Definition at line 400 of file SkPDFTypes.cpp.

400 {
401 this->append(SkPDFUnion::Bool(value));
402}
static SkPDFUnion Bool(bool)

◆ appendByteString() [1/2]

void SkPDFArray::appendByteString ( const char  value[])

Definition at line 424 of file SkPDFTypes.cpp.

424 {
425 this->append(SkPDFUnion::ByteString(value));
426}
static SkPDFUnion ByteString(const char *)

◆ appendByteString() [2/2]

void SkPDFArray::appendByteString ( SkString  value)

Definition at line 416 of file SkPDFTypes.cpp.

416 {
417 this->append(SkPDFUnion::ByteString(std::move(value)));
418}

◆ appendColorComponent()

void SkPDFArray::appendColorComponent ( uint8_t  value)

Definition at line 396 of file SkPDFTypes.cpp.

396 {
397 this->append(SkPDFUnion::ColorComponent(value));
398}
static SkPDFUnion ColorComponent(uint8_t)

◆ appendInt()

void SkPDFArray::appendInt ( int32_t  value)

Appends a value to the end of the array.

Parameters
valueThe value to add to the array.

Definition at line 392 of file SkPDFTypes.cpp.

392 {
393 this->append(SkPDFUnion::Int(value));
394}
static SkPDFUnion Int(int32_t)

◆ appendName() [1/2]

void SkPDFArray::appendName ( const char  name[])

Definition at line 408 of file SkPDFTypes.cpp.

408 {
409 this->append(SkPDFUnion::Name(SkString(name)));
410}
static SkPDFUnion Name(const char *)
const char * name
Definition fuchsia.cc:50

◆ appendName() [2/2]

void SkPDFArray::appendName ( SkString  name)

Definition at line 412 of file SkPDFTypes.cpp.

412 {
413 this->append(SkPDFUnion::Name(std::move(name)));
414}

◆ appendObject()

void SkPDFArray::appendObject ( std::unique_ptr< SkPDFObject > &&  objSp)

Definition at line 432 of file SkPDFTypes.cpp.

432 {
433 this->append(SkPDFUnion::Object(std::move(objSp)));
434}
static SkPDFUnion Object(std::unique_ptr< SkPDFObject >)

◆ appendRef()

void SkPDFArray::appendRef ( SkPDFIndirectReference  ref)

Definition at line 436 of file SkPDFTypes.cpp.

436 {
437 this->append(SkPDFUnion::Ref(ref));
438}
static SkPDFUnion Ref(SkPDFIndirectReference)

◆ appendScalar()

void SkPDFArray::appendScalar ( SkScalar  value)

Definition at line 404 of file SkPDFTypes.cpp.

404 {
405 this->append(SkPDFUnion::Scalar(value));
406}
static SkPDFUnion Scalar(SkScalar)

◆ appendTextString() [1/2]

void SkPDFArray::appendTextString ( const char  value[])

Definition at line 428 of file SkPDFTypes.cpp.

428 {
429 this->append(SkPDFUnion::TextString(value));
430}
static SkPDFUnion TextString(const char *)

◆ appendTextString() [2/2]

void SkPDFArray::appendTextString ( SkString  value)

Definition at line 420 of file SkPDFTypes.cpp.

420 {
421 this->append(SkPDFUnion::TextString(std::move(value)));
422}

◆ emitObject()

void SkPDFArray::emitObject ( SkWStream stream) const
overridevirtual

Subclasses must implement this method to print the object to the PDF file.

Parameters
catalogThe object catalog to use.
streamThe writable output stream to send the output to.

Implements SkPDFObject.

Definition at line 377 of file SkPDFTypes.cpp.

377 {
378 stream->writeText("[");
379 for (size_t i = 0; i < fValues.size(); i++) {
380 fValues[i].emitObject(stream);
381 if (i + 1 < fValues.size()) {
382 stream->writeText(" ");
383 }
384 }
385 stream->writeText("]");
386}

◆ reserve()

void SkPDFArray::reserve ( int  length)

Preallocate space for the given number of entries.

Parameters
lengthThe number of array slots to preallocate.

Definition at line 373 of file SkPDFTypes.cpp.

373 {
374 fValues.reserve(length);
375}
size_t length

◆ size()

size_t SkPDFArray::size ( ) const

The size of the array.

Definition at line 371 of file SkPDFTypes.cpp.

371{ return fValues.size(); }

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