[][src]Struct opencv::core::FileNode

pub struct FileNode { /* fields omitted */ }

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.

Methods

impl FileNode[src]

pub fn as_raw_FileNode(&self) -> *mut c_void[src]

pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self[src]

impl FileNode[src]

pub fn default() -> Result<FileNode>[src]

The constructors.

These constructors are used to create a default file node, construct it from obsolete structures or from the another file node.

pub fn copy(node: &FileNode) -> Result<FileNode>[src]

Parameters

  • node: File node to be used as initialization for the created file node.

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

Returns keys of a mapping node.

Returns

Keys of a mapping node.

pub fn _type(&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 to_int(&self) -> Result<i32>[src]

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

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

returns the node content as float

pub fn to_double(&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 read_raw(&self, fmt: &str, vec: &mut u8, 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 read_obj(&self) -> Result<&mut c_void>[src]

reads the registered object and returns pointer to it

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.

Trait Implementations

impl Drop for FileNode[src]

impl Send for FileNode[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for 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.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]