pub struct NDPluginFileBase {
pub file_path: String,
pub file_name: String,
pub file_number: i32,
pub file_template: String,
pub auto_increment: bool,
pub temp_suffix: String,
pub create_dir: i32,
/* private fields */
}Expand description
File path/name management and capture buffering for file plugins.
Fields§
§file_path: String§file_name: String§file_number: i32§file_template: String§auto_increment: bool§temp_suffix: String§create_dir: i32Implementations§
Source§impl NDPluginFileBase
impl NDPluginFileBase
pub fn new() -> Self
Sourcepub fn create_file_name(&self) -> String
pub fn create_file_name(&self) -> String
Construct the full file path from template/path/name/number.
Mimics C epicsSnprintf(buf, ..., template, filePath, fileName, fileNumber).
Template uses printf-style: first %s → filePath, second %s → fileName,
%d (with optional width/precision like %3.3d) → fileNumber.
Sourcepub fn temp_file_path(&self) -> Option<PathBuf>
pub fn temp_file_path(&self) -> Option<PathBuf>
Get the temp file path (if temp_suffix is set).
Sourcepub fn last_written_name(&self) -> &str
pub fn last_written_name(&self) -> &str
Return the full file name that was last written.
Sourcepub fn ensure_directory(&self) -> ADResult<()>
pub fn ensure_directory(&self) -> ADResult<()>
Create directory if needed. C ADCore behavior: createDir != 0 → create directories. Positive or negative values both trigger creation (negative = depth hint in C, but in practice create_dir_all handles any depth).
Sourcepub fn process_array(
&mut self,
array: Arc<NDArray>,
writer: &mut dyn NDFileWriter,
) -> ADResult<()>
pub fn process_array( &mut self, array: Arc<NDArray>, writer: &mut dyn NDFileWriter, ) -> ADResult<()>
Process an incoming array according to the current file mode.
Sourcepub fn flush_capture(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
pub fn flush_capture(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
Flush capture buffer: open file, write all buffered arrays, close.
Sourcepub fn close_stream(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
pub fn close_stream(&mut self, writer: &mut dyn NDFileWriter) -> ADResult<()>
Close stream mode.