[−][src]Struct kerbalobjects::StringTable
Represents a list of strings in a KO file that can be used as the names of symbols or as file comments or notes
Implementations
impl StringTable
[src]
pub fn new(name: &str) -> StringTable
[src]
Creates a new string table with the specified name
pub fn read(
reader: &mut KOFileReader,
header: &SectionHeader
) -> Result<StringTable, Box<dyn Error>>
[src]
reader: &mut KOFileReader,
header: &SectionHeader
) -> Result<StringTable, Box<dyn Error>>
Reads the string table from the KO file reader, and returns it
pub fn write(&self, writer: &mut KOFileWriter) -> Result<(), Box<dyn Error>>
[src]
Writes the entire string table to the KO file
pub fn size(&self) -> u32
[src]
Returns the size of this string table in bytes
pub fn add(&mut self, s: &str) -> usize
[src]
Adds a string to the string table This function checks first to see if the string already exists in the string table, which could possibly save space. If it does, it returns the index of that string. If it doesn't find it, the string is added to the string table.
pub fn add_no_check(&mut self, s: &str) -> usize
[src]
Adds a string to the string table unconditionally Returns the index of the string in the string table See add()
pub fn get(&self, index: usize) -> Result<&String, Box<dyn Error>>
[src]
Returns the specific string at an index into the internal vector of strings
pub fn name(&self) -> &String
[src]
Returns the name of this string table
pub fn get_strings(&self) -> &Vec<String>
[src]
Returns a reference to the internal vector containing all strings in this string table
Auto Trait Implementations
impl RefUnwindSafe for StringTable
[src]
impl Send for StringTable
[src]
impl Sync for StringTable
[src]
impl Unpin for StringTable
[src]
impl UnwindSafe for StringTable
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,