pub struct StringStore {
pub entities: EntityTable,
/* private fields */
}Expand description
Storage for PostScript string byte data.
Fields§
§entities: EntityTableImplementations§
Source§impl StringStore
impl StringStore
pub fn new() -> Self
Sourcepub fn allocate(&mut self, len: usize) -> EntityId
pub fn allocate(&mut self, len: usize) -> EntityId
Allocate len zero-filled bytes, returning an EntityId.
Sourcepub fn allocate_from(&mut self, bytes: &[u8]) -> EntityId
pub fn allocate_from(&mut self, bytes: &[u8]) -> EntityId
Allocate and copy bytes into the store.
Sourcepub fn allocate_from_with(
&mut self,
bytes: &[u8],
save_level: u16,
global: bool,
created_after_save: u32,
) -> EntityId
pub fn allocate_from_with( &mut self, bytes: &[u8], save_level: u16, global: bool, created_after_save: u32, ) -> EntityId
Allocate and copy bytes with a specific save level and global flag.
Sourcepub fn allocate_with(
&mut self,
len: usize,
save_level: u16,
global: bool,
created_after_save: u32,
) -> EntityId
pub fn allocate_with( &mut self, len: usize, save_level: u16, global: bool, created_after_save: u32, ) -> EntityId
Allocate with a specific save level and global flag.
Sourcepub fn get(&self, entity: EntityId, start: u32, len: u32) -> &[u8] ⓘ
pub fn get(&self, entity: EntityId, start: u32, len: u32) -> &[u8] ⓘ
Get a slice of the string data via entity table indirection.
start is the byte offset from the entity’s base; len is the number of bytes.
Sourcepub fn get_mut(&mut self, entity: EntityId, start: u32, len: u32) -> &mut [u8] ⓘ
pub fn get_mut(&mut self, entity: EntityId, start: u32, len: u32) -> &mut [u8] ⓘ
Get a mutable slice of the string data via entity table indirection.
start is the byte offset from the entity’s base; len is the number of bytes.
Sourcepub fn cow_copy(&mut self, entity: EntityId) -> EntityId
pub fn cow_copy(&mut self, entity: EntityId) -> EntityId
Copy entity data to a new region (for COW). Returns the new EntityId pointing to the copy. The original entity’s offset is updated to point at the copy, so the original EntityId now sees the new data.
Sourcepub fn swap_offsets(&mut self, a: EntityId, b: EntityId)
pub fn swap_offsets(&mut self, a: EntityId, b: EntityId)
Swap offsets between two entities (used by restore).