Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkSL::FileOutputStream Class Reference

#include <SkSLFileOutputStream.h>

Inheritance diagram for SkSL::FileOutputStream:
SkSL::OutputStream

Public Member Functions

 FileOutputStream (const char *name)
 
 ~FileOutputStream () override
 
bool isValid () const override
 
void write8 (uint8_t b) override
 
void writeText (const char *s) override
 
void write (const void *s, size_t size) override
 
bool close ()
 
- Public Member Functions inherited from SkSL::OutputStream
virtual bool isValid () const
 
virtual void write8 (uint8_t b)=0
 
void write16 (uint16_t i)
 
void write32 (uint32_t i)
 
virtual void writeText (const char *s)=0
 
virtual void write (const void *s, size_t size)=0
 
void writeString (const std::string &s)
 
void printf (const char format[],...) SK_PRINTF_LIKE(2
 
void void appendVAList (const char format[], va_list args) SK_PRINTF_LIKE(2
 
void void virtual ~OutputStream ()
 

Detailed Description

Definition at line 17 of file SkSLFileOutputStream.h.

Constructor & Destructor Documentation

◆ FileOutputStream()

SkSL::FileOutputStream::FileOutputStream ( const char *  name)
inline

Definition at line 19 of file SkSLFileOutputStream.h.

19 {
20 fFile = fopen(name, "wb");
21 }
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ ~FileOutputStream()

SkSL::FileOutputStream::~FileOutputStream ( )
inlineoverride

Definition at line 23 of file SkSLFileOutputStream.h.

23 {
24 if (fOpen) {
25 close();
26 }
27 }

Member Function Documentation

◆ close()

bool SkSL::FileOutputStream::close ( )
inline

Definition at line 60 of file SkSLFileOutputStream.h.

60 {
61 fOpen = false;
62 if (isValid() && fclose(fFile)) {
63 fFile = nullptr;
64 return false;
65 }
66 return true;
67 }
bool isValid() const override

◆ isValid()

bool SkSL::FileOutputStream::isValid ( ) const
inlineoverridevirtual

Reimplemented from SkSL::OutputStream.

Definition at line 29 of file SkSLFileOutputStream.h.

29 {
30 return nullptr != fFile;
31 }

◆ write()

void SkSL::FileOutputStream::write ( const void *  s,
size_t  size 
)
inlineoverridevirtual

Implements SkSL::OutputStream.

Definition at line 51 of file SkSLFileOutputStream.h.

51 {
52 if (isValid()) {
53 size_t written = fwrite(s, 1, size, fFile);
54 if (written != size) {
55 fFile = nullptr;
56 }
57 }
58 }
struct MyStruct s
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

◆ write8()

void SkSL::FileOutputStream::write8 ( uint8_t  b)
inlineoverridevirtual

Implements SkSL::OutputStream.

Definition at line 33 of file SkSLFileOutputStream.h.

33 {
34 SkASSERT(fOpen);
35 if (isValid()) {
36 if (EOF == fputc(b, fFile)) {
37 fFile = nullptr;
38 }
39 }
40 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static bool b

◆ writeText()

void SkSL::FileOutputStream::writeText ( const char *  s)
inlineoverridevirtual

Implements SkSL::OutputStream.

Definition at line 42 of file SkSLFileOutputStream.h.

42 {
43 SkASSERT(fOpen);
44 if (isValid()) {
45 if (EOF == fputs(s, fFile)) {
46 fFile = nullptr;
47 }
48 }
49 }

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