BSDL Device Tree Compiler
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | List of all members
dtc::dtb::output_writer Struct Referenceabstract
Inheritance diagram for dtc::dtb::output_writer:
dtc::dtb::asm_writer dtc::dtb::binary_writer

Public Member Functions

virtual void write_label (string name)=0
 
virtual void write_comment (string name)=0
 
virtual void write_string (string name)=0
 
virtual void write_data (uint8_t)=0
 
virtual void write_data (uint32_t)=0
 
virtual void write_data (uint64_t)=0
 
virtual void write_to_file (int fd)=0
 
virtual uint32_t size ()=0
 
void write_token (token_type t)
 
void write_data (byte_buffer b)
 

Detailed Description

Abstract class for writing a section of the output. We create one of these for each section that needs to be written. It is intended to build a temporary buffer of the output in memory and then write it to a file stream. The size can be returned after all of the data has been written into the internal buffer, so the sizes of the three tables can be calculated before storing them in the buffer.

Member Function Documentation

virtual uint32_t dtc::dtb::output_writer::size ( )
pure virtual

Returns the number of bytes.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_comment ( string  name)
pure virtual

Writes a comment into the output stream. Useful only when debugging the output.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_data ( uint8_t  )
pure virtual

Writes a single 8-bit value.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_data ( uint32_t  )
pure virtual

Writes a single 32-bit value. The value is written in big-endian format, but should be passed in the host's native endian.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_data ( uint64_t  )
pure virtual

Writes a single 64-bit value. The value is written in big-endian format, but should be passed in the host's native endian.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

void dtc::dtb::output_writer::write_data ( byte_buffer  b)
inline

Helper function that writes a byte buffer to the output, one byte at a time.

virtual void dtc::dtb::output_writer::write_label ( string  name)
pure virtual

Writes a label into the output stream. This is only applicable for assembly output, where the labels become symbols that can be resolved at link time.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_string ( string  name)
pure virtual

Writes a string. A nul terminator is implicitly added.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

virtual void dtc::dtb::output_writer::write_to_file ( int  fd)
pure virtual

Writes the collected output to the specified file descriptor.

Implemented in dtc::dtb::asm_writer, and dtc::dtb::binary_writer.

void dtc::dtb::output_writer::write_token ( token_type  t)
inline

Helper for writing tokens to the output stream. This writes a comment above the token describing its value, for easier debugging of the output.


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