2016-07-29 19:16:25 +08:00
|
|
|
/****************************************************************************
|
|
|
|
** Copyright (c) 2016, Fougue Ltd. <http://www.fougue.pro>
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
**
|
|
|
|
** 2. Redistributions in binary form must reproduce the above
|
|
|
|
** copyright notice, this list of conditions and the following
|
|
|
|
** disclaimer in the documentation and/or other materials provided
|
|
|
|
** with the distribution.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
|
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
|
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
|
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*! \file amf_io_options.h
|
|
|
|
* Options for AMF read/write functions
|
|
|
|
*
|
|
|
|
* \addtogroup gmio_amf
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GMIO_AMF_IO_OPTIONS_H
|
|
|
|
#define GMIO_AMF_IO_OPTIONS_H
|
|
|
|
|
|
|
|
#include "amf_global.h"
|
|
|
|
#include "../gmio_core/memblock.h"
|
|
|
|
#include "../gmio_core/task_iface.h"
|
|
|
|
#include "../gmio_core/text_format.h"
|
2016-12-08 23:02:35 +08:00
|
|
|
#include "../gmio_core/zlib_compress.h"
|
2016-07-29 19:16:25 +08:00
|
|
|
|
|
|
|
/*! Options of function gmio_amf_write()
|
|
|
|
*
|
|
|
|
* Initialising gmio_amf_write_options with \c {0} (or \c {} in C++) is the
|
|
|
|
* convenient way to set default values(passing \c NULL to gmio_amf_write() has
|
|
|
|
* the same effect).
|
|
|
|
*/
|
|
|
|
struct gmio_amf_write_options
|
|
|
|
{
|
2017-01-27 00:24:54 +08:00
|
|
|
/*! Used by the stream to bufferize I/O operations.
|
2016-07-29 19:16:25 +08:00
|
|
|
* If null, then a temporary memblock is created with the global default
|
|
|
|
* constructor function
|
|
|
|
* \sa gmio_memblock_isnull()
|
|
|
|
* \sa gmio_memblock_default() */
|
|
|
|
struct gmio_memblock stream_memblock;
|
|
|
|
|
|
|
|
/*! Optional interface by which the I/O operation can be controlled */
|
|
|
|
struct gmio_task_iface task_iface;
|
|
|
|
|
2017-01-27 00:24:54 +08:00
|
|
|
/*! The format used when writting double values as strings.
|
|
|
|
* Defaults to \c GMIO_FLOAT_TEXT_FORMAT_DECIMAL_LOWERCASE when calling
|
|
|
|
* gmio_amf_write() with \c options==NULL */
|
2016-07-29 19:16:25 +08:00
|
|
|
enum gmio_float_text_format float64_format;
|
|
|
|
|
2017-01-27 00:24:54 +08:00
|
|
|
/*! The maximum number of significant digits when writting \c double values.
|
|
|
|
* Defaults to \c 16 when calling gmio_amf_write() with \c options==NULL */
|
2016-07-29 19:16:25 +08:00
|
|
|
uint8_t float64_prec;
|
|
|
|
|
2016-12-23 20:06:24 +08:00
|
|
|
/* ZIP/Deflate compression */
|
2016-07-29 19:16:25 +08:00
|
|
|
|
2017-01-20 00:26:42 +08:00
|
|
|
/*! Flag to write AMF geometry in a ZIP archive containing one file entry.
|
|
|
|
* Options below have no effect if <tt>create_zip_archive==false</tt> */
|
|
|
|
bool create_zip_archive;
|
|
|
|
|
|
|
|
/*! Filename of the single AMF entry within the ZIP archive */
|
2016-12-23 20:06:24 +08:00
|
|
|
const char* zip_entry_filename;
|
2017-01-20 00:26:42 +08:00
|
|
|
|
|
|
|
/*! Filename length of the single AMF entry within the ZIP archive */
|
2016-12-23 20:06:24 +08:00
|
|
|
uint16_t zip_entry_filename_len;
|
2017-01-20 00:26:42 +08:00
|
|
|
|
|
|
|
/*! Flag to disable use of the Zip64 format extensions */
|
|
|
|
bool dont_use_zip64_extensions;
|
|
|
|
|
2017-01-27 00:24:54 +08:00
|
|
|
/*! Options for the zlib(deflate) compression */
|
2017-01-20 00:26:42 +08:00
|
|
|
struct gmio_zlib_compress_options z_compress_options;
|
2016-07-29 19:16:25 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* GMIO_AMF_IO_OPTIONS_H */
|
2017-01-09 17:52:06 +08:00
|
|
|
/*! @} */
|