Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkFILEWStream Class Reference

#include <SkStream.h>

Inheritance diagram for SkFILEWStream:
SkWStream

Public Member Functions

 SkFILEWStream (const char path[])
 
 ~SkFILEWStream () override
 
bool isValid () const
 
bool write (const void *buffer, size_t size) override
 
void flush () override
 
void fsync ()
 
size_t bytesWritten () const override
 
- Public Member Functions inherited from SkWStream
virtual ~SkWStream ()
 
 SkWStream ()
 
virtual bool write (const void *buffer, size_t size)=0
 
virtual void flush ()
 
virtual size_t bytesWritten () const =0
 
bool write8 (U8CPU value)
 
bool write16 (U16CPU value)
 
bool write32 (uint32_t v)
 
bool writeText (const char text[])
 
bool newline ()
 
bool writeDecAsText (int32_t)
 
bool writeBigDecAsText (int64_t, int minDigits=0)
 
bool writeHexAsText (uint32_t, int minDigits=0)
 
bool writeScalarAsText (SkScalar)
 
bool writeBool (bool v)
 
bool writeScalar (SkScalar)
 
bool writePackedUInt (size_t)
 
bool writeStream (SkStream *input, size_t length)
 

Additional Inherited Members

- Static Public Member Functions inherited from SkWStream
static int SizeOfPackedUInt (size_t value)
 

Detailed Description

Definition at line 435 of file SkStream.h.

Constructor & Destructor Documentation

◆ SkFILEWStream()

SkFILEWStream::SkFILEWStream ( const char  path[])

Definition at line 410 of file SkStream.cpp.

411{
413}
FILE * sk_fopen(const char path[], SkFILE_Flags)
@ kWrite_SkFILE_Flag
Definition: SkOSFile.h:21
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

◆ ~SkFILEWStream()

SkFILEWStream::~SkFILEWStream ( )
override

Definition at line 415 of file SkStream.cpp.

416{
417 if (fFILE) {
418 sk_fclose(fFILE);
419 }
420}
void sk_fclose(FILE *)

Member Function Documentation

◆ bytesWritten()

size_t SkFILEWStream::bytesWritten ( ) const
overridevirtual

Implements SkWStream.

Definition at line 422 of file SkStream.cpp.

422 {
423 return sk_ftell(fFILE);
424}
size_t sk_ftell(FILE *)

◆ flush()

void SkFILEWStream::flush ( )
overridevirtual

Reimplemented from SkWStream.

Definition at line 442 of file SkStream.cpp.

443{
444 if (fFILE) {
445 sk_fflush(fFILE);
446 }
447}
void sk_fflush(FILE *)

◆ fsync()

void SkFILEWStream::fsync ( )

Definition at line 449 of file SkStream.cpp.

450{
451 flush();
452 if (fFILE) {
453 sk_fsync(fFILE);
454 }
455}
void sk_fsync(FILE *)
void flush() override
Definition: SkStream.cpp:442

◆ isValid()

bool SkFILEWStream::isValid ( ) const
inline

Returns true if the current path could be opened.

Definition at line 442 of file SkStream.h.

442{ return fFILE != nullptr; }

◆ write()

bool SkFILEWStream::write ( const void *  buffer,
size_t  size 
)
overridevirtual

Called to write bytes to a SkWStream. Returns true on success

Parameters
bufferthe address of at least size bytes to be written to the stream
sizeThe number of bytes in buffer to write to the stream
Returns
true on success

Implements SkWStream.

Definition at line 426 of file SkStream.cpp.

427{
428 if (fFILE == nullptr) {
429 return false;
430 }
431
432 if (sk_fwrite(buffer, size, fFILE) != size)
433 {
434 SkDEBUGCODE(SkDebugf("SkFILEWStream failed writing %zu bytes\n", size);)
435 sk_fclose(fFILE);
436 fFILE = nullptr;
437 return false;
438 }
439 return true;
440}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
size_t sk_fwrite(const void *buffer, size_t byteCount, FILE *)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259

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