class PseudoFile

Defined at line 50 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h

A pseudo-file is a file-like object whose content is generated and modified dynamically

on-the-fly by invoking handler functions rather than being directly persisted as a sequence of

bytes.

This class is designed to allow programs to publish read-only, write-only, or read-write

properties such as configuration options, debug flags, and dumps of internal state which may

change dynamically.

A pseudo-file is readable when it has a non-null |ReadHandler|. Typically the read handler will

output a UTF-8 representation of some element of the program's state, or return an error if the

requested information is not available. The read handler is not expected to have side-effects

(but it can).

A pseudo-file is writable when it has a non-null |WriteHandler|. Typically the write handler

will parse the input in a UTF-8 representation and update the program's state in response, or

return an error if the input is invalid.

Although pseudo-files usually contain text, they can also be used for binary data.

There is no guarantee that data written to the pseudo-file can be read back from the pseudo-file

in the same form; it's not a real file after all.

This is an abstract class. The concrete implementations are |BufferedPseudoFile| and

|UnbufferedPseudoFile|.

Protected Members

function_impl read_handler_
function_impl write_handler_

Public Methods

void ~PseudoFile ()

Defined at line 30 of file ../../src/storage/lib/vfs/cpp/pseudo_file.cc

fuchsia_io::NodeProtocolKinds GetProtocols ()

|Vnode| implementation:

Defined at line 32 of file ../../src/storage/lib/vfs/cpp/pseudo_file.cc

bool ValidateRights (fuchsia_io::Rights rights)

Defined at line 36 of file ../../src/storage/lib/vfs/cpp/pseudo_file.cc

Protected Methods

void PseudoFile (ReadHandler read_handler, WriteHandler write_handler)

Defined at line 27 of file ../../src/storage/lib/vfs/cpp/pseudo_file.cc

void PseudoFile (const PseudoFile & )

Defined at line 70 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h

void PseudoFile (PseudoFile && )

Defined at line 70 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h

PseudoFile & operator= (const PseudoFile & )

Defined at line 70 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h

PseudoFile & operator= (PseudoFile && )

Defined at line 70 of file ../../src/storage/lib/vfs/cpp/pseudo_file.h