[][src]Struct kerbalobjects::KOFile

pub struct KOFile { /* fields omitted */ }

A structure that represents an entire KO file

Implementations

impl KOFile[src]

pub fn new() -> KOFile[src]

Creates a new KO file from nothing

pub fn read(reader: &mut KOFileReader) -> Result<KOFile, Box<dyn Error>>[src]

Reads a KO file from the provided reader and returns it if it was successful

pub fn write(&mut self, writer: &mut KOFileWriter) -> Result<(), Box<dyn Error>>[src]

Writes a KO file to the provided writer

pub fn is_entry_point(&self) -> bool[src]

This function returns true if the KO file contains the main .text section

pub fn get_header_table(&mut self) -> &mut HeaderTable[src]

Returns the KO file's current header table

pub fn get_symstrtab(&mut self) -> &mut StringTable[src]

Returns a reference to the KO file's symbol string table

pub fn get_symdata(&mut self) -> &mut SymbolDataSection[src]

Returns a reference to the KO file's symbol data section

pub fn get_symtab(&mut self) -> &mut SymbolTable[src]

Returns a reference to the KO file's symbol table

pub fn get_debug(&mut self) -> Option<&mut DebugSection>[src]

Returns an option that either contains this KO file's debug section if it has one, or None

pub fn get_code_sections(&mut self) -> &Vec<RelSection>[src]

Returns a reference to the internal vector of code sections

pub fn get_string_tables(&mut self) -> &Vec<StringTable>[src]

Returns a reference to the internal vector of string tables

pub fn add_symbol(&mut self, symbol: Symbol) -> usize[src]

Adds a symbol to the symbol table and symbol string tables in the proper way

pub fn add_code_section(&mut self, code_section: RelSection)[src]

This function adds a code section to the internal vector of code sections

pub fn add_string_table(&mut self, string_table: StringTable)[src]

This function adds a string table to the internal vector of string tables

pub fn set_debug(&mut self, debug: DebugSection)[src]

This function sets this KO file's debug section

pub fn length(&self) -> u32[src]

Returns the length of the entire file in bytes

pub fn version(&self) -> u8[src]

Returns the current KO file version number of this file

pub fn num_sections(&self) -> u16[src]

Returns the number of sections that this KO file contains

pub fn regenerate_headers(&mut self)[src]

Regenerates all section headers and their associated data like sizes and offsets

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.