rpfm_lib/files/sound_bank/sections/hirc/object/auxiliary_bus/v122.rs
1//---------------------------------------------------------------------------//
2// Copyright (c) 2017-2024 Ismael Gutiérrez González. All rights reserved.
3//
4// This file is part of the Rusted PackFile Manager (RPFM) project,
5// which can be found here: https://github.com/Frodo45127/rpfm.
6//
7// This file is licensed under the MIT license, which can be found here:
8// https://github.com/Frodo45127/rpfm/blob/master/LICENSE.
9//---------------------------------------------------------------------------//
10
11use crate::binary::{ReadBytes, WriteBytes};
12use crate::error::Result;
13
14use super::*;
15
16//---------------------------------------------------------------------------//
17// Implementation
18//---------------------------------------------------------------------------//
19
20impl AuxiliaryBus {
21
22 pub(crate) fn read_v122<R: ReadBytes>(data: &mut R, size: usize) -> Result<Self> {
23 Ok(Self {
24 data: data.read_slice(size, false)?,
25 })
26 }
27
28 pub(crate) fn write_v122<W: WriteBytes>(&self, buffer: &mut W) -> Result<()> {
29 buffer.write_all(&self.data)?;
30
31 Ok(())
32 }
33}