@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_core.class) public class FileStorage extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
APPEND
enum cv::FileStorage::Mode
|
static int |
BASE64
enum cv::FileStorage::Mode
|
static int |
FORMAT_AUTO
enum cv::FileStorage::Mode
|
static int |
FORMAT_JSON
enum cv::FileStorage::Mode
|
static int |
FORMAT_MASK
enum cv::FileStorage::Mode
|
static int |
FORMAT_XML
enum cv::FileStorage::Mode
|
static int |
FORMAT_YAML
enum cv::FileStorage::Mode
|
static int |
INSIDE_MAP
enum cv::FileStorage::State
|
static int |
MEMORY
enum cv::FileStorage::Mode
|
static int |
NAME_EXPECTED
enum cv::FileStorage::State
|
static int |
READ
enum cv::FileStorage::Mode
|
static int |
UNDEFINED
enum cv::FileStorage::State
|
static int |
VALUE_EXPECTED
enum cv::FileStorage::State
|
static int |
WRITE
enum cv::FileStorage::Mode
|
static int |
WRITE_BASE64
enum cv::FileStorage::Mode
|
Constructor and Description |
---|
FileStorage()
\brief The constructors.
|
FileStorage(BytePointer filename,
int flags) |
FileStorage(BytePointer filename,
int flags,
BytePointer encoding)
\overload
\copydoc open()
|
FileStorage(long size)
Native array allocator.
|
FileStorage(Pointer p)
Pointer cast constructor.
|
FileStorage(String filename,
int flags) |
FileStorage(String filename,
int flags,
String encoding) |
Modifier and Type | Method and Description |
---|---|
BytePointer |
elname() |
FileStorage |
elname(BytePointer setter) |
void |
endWriteStruct() |
FileNode |
get(BytePointer nodename)
\brief Returns the specified element of the top-level mapping.
|
FileNode |
get(String nodename) |
static BytePointer |
getDefaultObjectName(BytePointer filename)
\brief Returns the normalized object name for the specified name of a file.
|
static String |
getDefaultObjectName(String filename) |
FileNode |
getFirstTopLevelNode()
\brief Returns the first element of the top-level mapping.
|
int |
getFormat()
\brief Returns the current format.
|
FileNode |
getNode(BytePointer nodename)
\overload
|
FileNode |
getNode(String nodename) |
boolean |
isOpened()
\brief Checks whether the file is opened.
|
boolean |
open(BytePointer filename,
int flags) |
boolean |
open(BytePointer filename,
int flags,
BytePointer encoding)
\brief Opens a file.
|
boolean |
open(String filename,
int flags) |
boolean |
open(String filename,
int flags,
String encoding) |
FileStorage |
position(long position) |
void |
release()
\brief Closes the file and releases all the memory buffers.
|
BytePointer |
releaseAndGetString()
\brief Closes the file and releases all the memory buffers.
|
FileNode |
root() |
FileNode |
root(int streamidx)
\brief Returns the top-level mapping
|
void |
startWriteStruct(BytePointer name,
int flags,
BytePointer typeName) |
void |
startWriteStruct(String name,
int flags,
String typeName) |
int |
state() |
FileStorage |
state(int setter) |
void |
write(BytePointer name,
BytePointer val)
\overload
|
void |
write(BytePointer name,
double val)
\overload
|
void |
write(BytePointer name,
int val)
\brief Simplified writing API to use with bindings.
|
void |
write(BytePointer name,
Mat val)
\overload
|
void |
write(BytePointer name,
StringVector val)
\overload
|
void |
write(String name,
double val) |
void |
write(String name,
int val) |
void |
write(String name,
Mat val) |
void |
write(String name,
String val) |
void |
write(String name,
StringVector val) |
void |
writeComment(BytePointer comment) |
void |
writeComment(BytePointer comment,
boolean append)
\brief Writes a comment.
|
void |
writeComment(String comment) |
void |
writeComment(String comment,
boolean append) |
void |
writeRaw(BytePointer fmt,
Pointer vec,
long len)
\brief Writes multiple numbers.
|
void |
writeRaw(String fmt,
Pointer vec,
long len) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, hashCode, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, parseBytes, physicalBytes, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalPhysicalBytes, withDeallocator, zero
public static final int READ
public static final int WRITE
public static final int APPEND
public static final int MEMORY
public static final int FORMAT_MASK
public static final int FORMAT_AUTO
public static final int FORMAT_XML
public static final int FORMAT_YAML
public static final int FORMAT_JSON
public static final int BASE64
public static final int WRITE_BASE64
public static final int UNDEFINED
public static final int VALUE_EXPECTED
public static final int NAME_EXPECTED
public static final int INSIDE_MAP
public FileStorage(Pointer p)
Pointer.Pointer(Pointer)
.public FileStorage(long size)
Pointer.position(long)
.public FileStorage()
The full constructor opens the file. Alternatively you can use the default constructor and then call FileStorage::open.
public FileStorage(@opencv_core.Str BytePointer filename, int flags, @opencv_core.Str BytePointer encoding)
public FileStorage(@opencv_core.Str BytePointer filename, int flags)
public FileStorage(@opencv_core.Str String filename, int flags, @opencv_core.Str String encoding)
public FileStorage(@opencv_core.Str String filename, int flags)
public FileStorage position(long position)
@Cast(value="bool") public boolean open(@opencv_core.Str BytePointer filename, int flags, @opencv_core.Str BytePointer encoding)
See description of parameters in FileStorage::FileStorage. The method calls FileStorage::release before opening the file.
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::Modeencoding
- Encoding of the file. Note that UTF-16 XML encoding is not supported currently and
you should use 8-bit encoding instead of it.@Cast(value="bool") public boolean open(@opencv_core.Str BytePointer filename, int flags)
@Cast(value="bool") public boolean open(@opencv_core.Str String filename, int flags, @opencv_core.Str String encoding)
@Cast(value="bool") public boolean open(@opencv_core.Str String filename, int flags)
@Cast(value="bool") public boolean isOpened()
public void release()
Call this method after all I/O operations with the storage are finished.
@opencv_core.Str public BytePointer releaseAndGetString()
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
@ByVal public FileNode getFirstTopLevelNode()
@ByVal public FileNode root(int streamidx)
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.@ByVal @Name(value="operator []") public FileNode get(@opencv_core.Str BytePointer nodename)
nodename
- Name of the file node.@ByVal @Name(value="operator []") public FileNode getNode(@Cast(value="const char*") BytePointer nodename)
public void write(@opencv_core.Str BytePointer name, int val)
name
- Name of the written objectval
- Value of the written objectpublic void write(@opencv_core.Str String name, int val)
public void write(@opencv_core.Str BytePointer name, double val)
public void write(@opencv_core.Str String name, double val)
public void write(@opencv_core.Str BytePointer name, @opencv_core.Str BytePointer val)
public void write(@opencv_core.Str String name, @opencv_core.Str String val)
public void write(@opencv_core.Str BytePointer name, @Const @ByRef Mat val)
public void write(@opencv_core.Str String name, @Const @ByRef Mat val)
public void write(@opencv_core.Str BytePointer name, @Const @ByRef StringVector val)
public void write(@opencv_core.Str String name, @Const @ByRef StringVector val)
public void writeRaw(@opencv_core.Str BytePointer fmt, @Const Pointer vec, @Cast(value="size_t") long len)
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.
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.public void writeRaw(@opencv_core.Str String fmt, @Const Pointer vec, @Cast(value="size_t") long len)
public void writeComment(@opencv_core.Str BytePointer comment, @Cast(value="bool") boolean append)
The function writes a comment into file storage. The comments are skipped when the storage is read.
comment
- The written comment, single-line or multi-lineappend
- 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.public void writeComment(@opencv_core.Str BytePointer comment)
public void writeComment(@opencv_core.Str String comment, @Cast(value="bool") boolean append)
public void writeComment(@opencv_core.Str String comment)
public void startWriteStruct(@opencv_core.Str BytePointer name, int flags, @opencv_core.Str BytePointer typeName)
public void startWriteStruct(@opencv_core.Str String name, int flags, @opencv_core.Str String typeName)
public void endWriteStruct()
@opencv_core.Str public static BytePointer getDefaultObjectName(@opencv_core.Str BytePointer filename)
filename
- Name of a file@opencv_core.Str public static String getDefaultObjectName(@opencv_core.Str String filename)
public int getFormat()
public int state()
public FileStorage state(int setter)
@StdString public BytePointer elname()
public FileStorage elname(BytePointer setter)
Copyright © 2020. All rights reserved.