This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/blenloader/BLO_writefile.h
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00

73 lines
1.9 KiB
C++

/* SPDX-License-Identifier: GPL-2.0-or-later
* Copyright 2001-2002 NaN Holding BV. All rights reserved. */
#pragma once
/** \file
* \ingroup blenloader
* \brief external `writefile.c` function prototypes.
*/
#ifdef __cplusplus
extern "C" {
#endif
struct BlendThumbnail;
struct Main;
struct MemFile;
struct ReportList;
/* -------------------------------------------------------------------- */
/** \name BLO Write File API
*
* \see #BLO_read_from_file for file reading.
* \{ */
/**
* Adjust paths when saving (kept unless #BlendFileWriteParams.use_save_as_copy is set).
*/
typedef enum eBLO_WritePathRemap {
/** No path manipulation. */
BLO_WRITE_PATH_REMAP_NONE = 0,
/** Remap existing relative paths (default). */
BLO_WRITE_PATH_REMAP_RELATIVE = 1,
/** Remap paths making all paths relative to the new location. */
BLO_WRITE_PATH_REMAP_RELATIVE_ALL = 2,
/** Make all paths absolute. */
BLO_WRITE_PATH_REMAP_ABSOLUTE = 3,
} eBLO_WritePathRemap;
/** Similar to #BlendFileReadParams. */
struct BlendFileWriteParams {
eBLO_WritePathRemap remap_mode;
/** Save `.blend1`, `.blend2`... etc. */
uint use_save_versions : 1;
/** On write, restore paths after editing them (see #BLO_WRITE_PATH_REMAP_RELATIVE). */
uint use_save_as_copy : 1;
uint use_userdef : 1;
const struct BlendThumbnail *thumb;
};
/**
* \return Success.
*/
extern bool BLO_write_file(struct Main *mainvar,
const char *filepath,
int write_flags,
const struct BlendFileWriteParams *params,
struct ReportList *reports);
/**
* \return Success.
*/
extern bool BLO_write_file_mem(struct Main *mainvar,
struct MemFile *compare,
struct MemFile *current,
int write_flags);
/** \} */
#ifdef __cplusplus
}
#endif