[][src]Trait opencv::prelude::FileNodeTrait

pub trait FileNodeTrait {
    pub fn as_raw_FileNode(&self) -> *const c_void;
pub fn as_raw_mut_FileNode(&mut self) -> *mut c_void; pub fn block_idx(&self) -> size_t { ... }
pub fn set_block_idx(&mut self, val: size_t) { ... }
pub fn ofs(&self) -> size_t { ... }
pub fn set_ofs(&mut self, val: size_t) { ... }
pub fn get(&self, nodename: &str) -> Result<FileNode> { ... }
pub fn get_node(&self, nodename: &str) -> Result<FileNode> { ... }
pub fn at(&self, i: i32) -> Result<FileNode> { ... }
pub fn keys(&self) -> Result<Vector<String>> { ... }
pub fn typ(&self) -> Result<i32> { ... }
pub fn empty(&self) -> Result<bool> { ... }
pub fn is_none(&self) -> Result<bool> { ... }
pub fn is_seq(&self) -> Result<bool> { ... }
pub fn is_map(&self) -> Result<bool> { ... }
pub fn is_int(&self) -> Result<bool> { ... }
pub fn is_real(&self) -> Result<bool> { ... }
pub fn is_string(&self) -> Result<bool> { ... }
pub fn is_named(&self) -> Result<bool> { ... }
pub fn name(&self) -> Result<String> { ... }
pub fn size(&self) -> Result<size_t> { ... }
pub fn raw_size(&self) -> Result<size_t> { ... }
pub fn to_i32(&self) -> Result<i32> { ... }
pub fn to_f32(&self) -> Result<f32> { ... }
pub fn to_f64(&self) -> Result<f64> { ... }
pub fn to_string(&self) -> Result<String> { ... }
pub fn ptr(&mut self) -> Result<&mut u8> { ... }
pub fn ptr_1(&self) -> Result<&u8> { ... }
pub fn begin(&self) -> Result<FileNodeIterator> { ... }
pub fn end(&self) -> Result<FileNodeIterator> { ... }
pub fn read_raw(
        &self,
        fmt: &str,
        vec: *mut c_void,
        len: size_t
    ) -> Result<()> { ... }
pub fn set_value(
        &mut self,
        typ: i32,
        value: *const c_void,
        len: i32
    ) -> Result<()> { ... }
pub fn real(&self) -> Result<f64> { ... }
pub fn string(&self) -> Result<String> { ... }
pub fn mat(&self) -> Result<Mat> { ... } }

File Storage Node class.

The node is used to store each and every element of the file storage opened for reading. When XML/YAML file is read, it is first parsed and stored in the memory as a hierarchical collection of nodes. Each node can be a "leaf" that is contain a single number or a string, or be a collection of other nodes. There can be named collections (mappings) where each element has a name and it is accessed by a name, and ordered collections (sequences) where elements do not have names but rather accessed by index. Type of the file node can be determined using FileNode::type method.

Note that file nodes are only used for navigating file storages opened for reading. When a file storage is opened for writing, no data is stored in memory after it is written.

Required methods

Loading content...

Provided methods

pub fn block_idx(&self) -> size_t[src]

pub fn set_block_idx(&mut self, val: size_t)[src]

pub fn ofs(&self) -> size_t[src]

pub fn set_ofs(&mut self, val: size_t)[src]

pub fn get(&self, nodename: &str) -> Result<FileNode>[src]

Returns element of a mapping node or a sequence node.

Parameters

  • nodename: Name of an element in the mapping node.

Returns

Returns the element with the given identifier.

pub fn get_node(&self, nodename: &str) -> Result<FileNode>[src]

Returns element of a mapping node or a sequence node.

Parameters

  • nodename: Name of an element in the mapping node.

Returns

Returns the element with the given identifier.

Overloaded parameters

  • nodename: Name of an element in the mapping node.

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

Returns element of a mapping node or a sequence node.

Parameters

  • nodename: Name of an element in the mapping node.

Returns

Returns the element with the given identifier.

Overloaded parameters

  • i: Index of an element in the sequence node.

pub fn keys(&self) -> Result<Vector<String>>[src]

Returns keys of a mapping node.

Returns

Keys of a mapping node.

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

Returns type of the node.

Returns

Type of the node. See FileNode::Type

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

returns true if the node is empty

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

returns true if the node is a "none" object

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

returns true if the node is a sequence

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

returns true if the node is a mapping

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

returns true if the node is an integer

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

returns true if the node is a floating-point number

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

returns true if the node is a text string

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

returns true if the node has a name

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

returns the node name or an empty string if the node is nameless

pub fn size(&self) -> Result<size_t>[src]

returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.

pub fn raw_size(&self) -> Result<size_t>[src]

returns raw size of the FileNode in bytes

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

returns the node content as an integer. If the node stores floating-point number, it is rounded.

pub fn to_f32(&self) -> Result<f32>[src]

returns the node content as float

pub fn to_f64(&self) -> Result<f64>[src]

returns the node content as double

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

returns the node content as text string

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

pub fn ptr_1(&self) -> Result<&u8>[src]

pub fn begin(&self) -> Result<FileNodeIterator>[src]

returns iterator pointing to the first node element

pub fn end(&self) -> Result<FileNodeIterator>[src]

returns iterator pointing to the element following the last node element

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

Reads node elements to the buffer with the specified format.

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 destination array.
  • len: Number of bytes to read (buffer size limit). If it is greater than number of remaining elements then all of them will be read.

pub fn set_value(
    &mut self,
    typ: i32,
    value: *const c_void,
    len: i32
) -> Result<()>
[src]

Internal method used when reading FileStorage. Sets the type (int, real or string) and value of the previously created node.

C++ default parameters

  • len: -1

pub fn real(&self) -> Result<f64>[src]

Simplified reading API to use with bindings.

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

Simplified reading API to use with bindings.

pub fn mat(&self) -> Result<Mat>[src]

Simplified reading API to use with bindings.

Loading content...

Implementors

impl FileNodeTrait for FileNode[src]

Loading content...