[][src]Struct opencv::types::FileStorageRefMut

pub struct FileStorageRefMut<'o> { /* fields omitted */ }

Methods from Deref<Target = FileStorage>

pub fn open(
    &mut self,
    filename: &str,
    flags: i32,
    encoding: &str
) -> Result<bool>
[src]

Opens a file.

See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release before opening the file.

Parameters

  • filename: Name of the file to open or the text string to read the data from. Extension of the file (.xml, .yml/.yaml or .json) determines its format (XML, YAML or JSON respectively). Also you can append .gz to work with compressed files, for example myHugeMatrix.xml.gz. If both FileStorage::WRITE and FileStorage::MEMORY flags are specified, source is used just to specify the output file format (e.g. mydata.xml, .yml etc.). A file name can also contain parameters. You can use this format, "*?base64" (e.g. "file.json?base64" (case sensitive)), as an alternative to FileStorage::BASE64 flag.
  • flags: Mode of operation. One of FileStorage::Mode
  • encoding: Encoding of the file. Note that UTF-16 XML encoding is not supported currently and you should use 8-bit encoding instead of it.

C++ default parameters

  • encoding: String()

pub fn is_opened(&self) -> Result<bool>[src]

Checks whether the file is opened.

Returns

true if the object is associated with the current file and false otherwise. It is a good practice to call this method after you tried to open a file.

pub fn release(&mut self) -> Result<()>[src]

Closes the file and releases all the memory buffers.

Call this method after all I/O operations with the storage are finished.

pub fn release_and_get_string(&mut self) -> Result<String>[src]

Closes the file and releases all the memory buffers.

Call this method after all I/O operations with the storage are finished. If the storage was opened for writing data and FileStorage::WRITE was specified

pub fn get_first_top_level_node(&self) -> Result<FileNode>[src]

Returns the first element of the top-level mapping.

Returns

The first element of the top-level mapping.

pub fn root(&self, streamidx: i32) -> Result<FileNode>[src]

Returns the top-level mapping

Parameters

  • streamidx: Zero-based index of the stream. In most cases there is only one stream in the file. However, YAML supports multiple streams and so there can be several.

Returns

The top-level mapping.

C++ default parameters

  • streamidx: 0

pub fn write_i32(&mut self, name: &str, val: i32) -> Result<()>[src]

Simplified writing API to use with bindings.

Parameters

  • name: Name of the written object
  • val: Value of the written object

pub fn write_f64(&mut self, name: &str, val: f64) -> Result<()>[src]

pub fn write_str(&mut self, name: &str, val: &str) -> Result<()>[src]

pub fn write_mat(&mut self, name: &str, val: &Mat) -> Result<()>[src]

pub fn write_str_vec(&mut self, name: &str, val: &VectorOfString) -> Result<()>[src]

pub fn write_raw(&mut self, fmt: &str, vec: &c_void, len: size_t) -> Result<()>[src]

Writes multiple numbers.

Writes one or more numbers of the specified format to the currently written structure. Usually it is more convenient to use operator << instead of this method.

Parameters

  • fmt: Specification of each array element, see @ref format_spec "format specification"
  • vec: Pointer to the written array.
  • len: Number of the uchar elements to write.

pub fn write_comment(&mut self, comment: &str, append: bool) -> Result<()>[src]

Writes a comment.

The function writes a comment into file storage. The comments are skipped when the storage is read.

Parameters

  • comment: The written comment, single-line or multi-line
  • append: If true, the function tries to put the comment at the end of current line. Else if the comment is multi-line, or if it does not fit at the end of the current line, the comment starts a new line.

C++ default parameters

  • append: false

pub fn start_write_struct(
    &mut self,
    name: &str,
    flags: i32,
    type_name: &str
) -> Result<()>
[src]

pub fn end_write_struct(&mut self) -> Result<()>[src]

pub fn get_format(&self) -> Result<i32>[src]

Returns the current format.

Returns

The current format, see FileStorage::Mode

Trait Implementations

impl<'_> Deref for FileStorageRefMut<'_>[src]

type Target = FileStorage

The resulting type after dereferencing.

impl<'_> DerefMut for FileStorageRefMut<'_>[src]

Auto Trait Implementations

impl<'o> RefUnwindSafe for FileStorageRefMut<'o>

impl<'o> Send for FileStorageRefMut<'o>

impl<'o> !Sync for FileStorageRefMut<'o>

impl<'o> Unpin for FileStorageRefMut<'o>

impl<'o> !UnwindSafe for FileStorageRefMut<'o>

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.