Flutter Engine
The Flutter Engine
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 void emitObject (SkWStream *stream) const =0
 
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 373 of file SkPDFTypes.cpp.

373{}

◆ ~SkPDFArray()

SkPDFArray::~SkPDFArray ( )
override

Definition at line 375 of file SkPDFTypes.cpp.

375{}

Member Function Documentation

◆ appendBool()

void SkPDFArray::appendBool ( bool  value)

Definition at line 406 of file SkPDFTypes.cpp.

406 {
407 this->append(SkPDFUnion::Bool(value));
408}
static SkPDFUnion Bool(bool)
Definition: SkPDFTypes.cpp:317
uint8_t value

◆ appendByteString() [1/2]

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

Definition at line 430 of file SkPDFTypes.cpp.

430 {
431 this->append(SkPDFUnion::ByteString(value));
432}
static SkPDFUnion ByteString(const char *)
Definition: SkPDFTypes.cpp:331

◆ appendByteString() [2/2]

void SkPDFArray::appendByteString ( SkString  value)

Definition at line 422 of file SkPDFTypes.cpp.

422 {
423 this->append(SkPDFUnion::ByteString(std::move(value)));
424}

◆ appendColorComponent()

void SkPDFArray::appendColorComponent ( uint8_t  value)

Definition at line 402 of file SkPDFTypes.cpp.

402 {
403 this->append(SkPDFUnion::ColorComponent(value));
404}
static SkPDFUnion ColorComponent(uint8_t)
Definition: SkPDFTypes.cpp:309

◆ 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 398 of file SkPDFTypes.cpp.

398 {
399 this->append(SkPDFUnion::Int(value));
400}
static SkPDFUnion Int(int32_t)
Definition: SkPDFTypes.cpp:305

◆ appendName() [1/2]

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

Definition at line 414 of file SkPDFTypes.cpp.

414 {
415 this->append(SkPDFUnion::Name(SkString(name)));
416}
static SkPDFUnion Name(const char *)
Definition: SkPDFTypes.cpp:325
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ appendName() [2/2]

void SkPDFArray::appendName ( SkString  name)

Definition at line 418 of file SkPDFTypes.cpp.

418 {
419 this->append(SkPDFUnion::Name(std::move(name)));
420}

◆ appendObject()

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

Definition at line 438 of file SkPDFTypes.cpp.

438 {
439 this->append(SkPDFUnion::Object(std::move(objSp)));
440}
static SkPDFUnion Object(std::unique_ptr< SkPDFObject >)
Definition: SkPDFTypes.cpp:353

◆ appendRef()

void SkPDFArray::appendRef ( SkPDFIndirectReference  ref)

Definition at line 442 of file SkPDFTypes.cpp.

442 {
443 this->append(SkPDFUnion::Ref(ref));
444}
static SkPDFUnion Ref(SkPDFIndirectReference)
Definition: SkPDFTypes.cpp:358

◆ appendScalar()

void SkPDFArray::appendScalar ( SkScalar  value)

Definition at line 410 of file SkPDFTypes.cpp.

410 {
411 this->append(SkPDFUnion::Scalar(value));
412}
static SkPDFUnion Scalar(SkScalar)
Definition: SkPDFTypes.cpp:321

◆ appendTextString() [1/2]

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

Definition at line 434 of file SkPDFTypes.cpp.

434 {
435 this->append(SkPDFUnion::TextString(value));
436}
static SkPDFUnion TextString(const char *)
Definition: SkPDFTypes.cpp:336

◆ appendTextString() [2/2]

void SkPDFArray::appendTextString ( SkString  value)

Definition at line 426 of file SkPDFTypes.cpp.

426 {
427 this->append(SkPDFUnion::TextString(std::move(value)));
428}

◆ 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 383 of file SkPDFTypes.cpp.

383 {
384 stream->writeText("[");
385 for (size_t i = 0; i < fValues.size(); i++) {
386 fValues[i].emitObject(stream);
387 if (i + 1 < fValues.size()) {
388 stream->writeText(" ");
389 }
390 }
391 stream->writeText("]");
392}

◆ 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 379 of file SkPDFTypes.cpp.

379 {
380 fValues.reserve(length);
381}
size_t length

◆ size()

size_t SkPDFArray::size ( ) const

The size of the array.

Definition at line 377 of file SkPDFTypes.cpp.

377{ return fValues.size(); }

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