Trait opencv::core::prelude::FileNodeTraitConst [−][src]
pub trait FileNodeTraitConst {
Show 30 methods
fn as_raw_FileNode(&self) -> *const c_void;
fn block_idx(&self) -> size_t { ... }
fn ofs(&self) -> size_t { ... }
fn get(&self, nodename: &str) -> Result<FileNode> { ... }
fn get_node(&self, nodename: &str) -> Result<FileNode> { ... }
fn at(&self, i: i32) -> Result<FileNode> { ... }
fn keys(&self) -> Result<Vector<String>> { ... }
fn typ(&self) -> Result<i32> { ... }
fn empty(&self) -> Result<bool> { ... }
fn is_none(&self) -> Result<bool> { ... }
fn is_seq(&self) -> Result<bool> { ... }
fn is_map(&self) -> Result<bool> { ... }
fn is_int(&self) -> Result<bool> { ... }
fn is_real(&self) -> Result<bool> { ... }
fn is_string(&self) -> Result<bool> { ... }
fn is_named(&self) -> Result<bool> { ... }
fn name(&self) -> Result<String> { ... }
fn size(&self) -> Result<size_t> { ... }
fn raw_size(&self) -> Result<size_t> { ... }
fn to_i32(&self) -> Result<i32> { ... }
fn to_f32(&self) -> Result<f32> { ... }
fn to_f64(&self) -> Result<f64> { ... }
fn to_string(&self) -> Result<String> { ... }
fn ptr(&self) -> Result<*const u8> { ... }
fn begin(&self) -> Result<FileNodeIterator> { ... }
fn end(&self) -> Result<FileNodeIterator> { ... }
unsafe fn read_raw(
&self,
fmt: &str,
vec: *mut c_void,
len: size_t
) -> Result<()> { ... }
fn real(&self) -> Result<f64> { ... }
fn string(&self) -> Result<String> { ... }
fn mat(&self) -> Result<Mat> { ... }
}
Expand description
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
fn as_raw_FileNode(&self) -> *const c_void
Provided methods
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.
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.
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.
returns the node name or an empty string if the node is nameless
returns the number of elements in the node, if it is a sequence or mapping, or 1 otherwise.
returns the node content as an integer. If the node stores floating-point number, it is rounded.
fn begin(&self) -> Result<FileNodeIterator>
fn begin(&self) -> Result<FileNodeIterator>
returns iterator pointing to the first node element
fn end(&self) -> Result<FileNodeIterator>
fn end(&self) -> Result<FileNodeIterator>
returns iterator pointing to the element following the last node element
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.