Sourcemeta Core 0.0.0
Loading...
Searching...
No Matches
metapack_write.h
1#ifndef SOURCEMETA_CORE_METAPACK_WRITE_H_
2#define SOURCEMETA_CORE_METAPACK_WRITE_H_
3
4#ifndef SOURCEMETA_CORE_METAPACK_EXPORT
5#include <sourcemeta/core/metapack_export.h>
6#endif
7
8// NOLINTBEGIN(misc-include-cleaner)
9#include <sourcemeta/core/metapack_error.h>
10#include <sourcemeta/core/metapack_format.h>
11// NOLINTEND(misc-include-cleaner)
12
13#include <sourcemeta/core/json.h>
14
15#include <cstdint> // std::uint8_t
16#include <filesystem> // std::filesystem::path
17#include <span> // std::span
18#include <string_view> // std::string_view
19
20namespace sourcemeta::core {
21
35SOURCEMETA_CORE_METAPACK_EXPORT
36auto metapack_write_json(const std::filesystem::path &destination,
37 const JSON &document,
38 const std::string_view media_type,
39 const MetapackEncoding encoding,
40 const std::span<const std::uint8_t> extension = {})
41 -> void;
42
57SOURCEMETA_CORE_METAPACK_EXPORT
59 const std::filesystem::path &destination, const JSON &document,
60 const std::string_view media_type, const MetapackEncoding encoding,
61 const std::span<const std::uint8_t> extension = {}) -> void;
62
75SOURCEMETA_CORE_METAPACK_EXPORT
76auto metapack_write_text(const std::filesystem::path &destination,
77 const std::string_view contents,
78 const std::string_view media_type,
79 const MetapackEncoding encoding,
80 const std::span<const std::uint8_t> extension = {})
81 -> void;
82
96SOURCEMETA_CORE_METAPACK_EXPORT
97auto metapack_write_bytes(const std::filesystem::path &destination,
98 const std::span<const std::uint8_t> contents,
99 const std::string_view media_type,
100 const MetapackEncoding encoding,
101 const std::span<const std::uint8_t> extension = {})
102 -> void;
103
115SOURCEMETA_CORE_METAPACK_EXPORT
116auto metapack_write_file(const std::filesystem::path &destination,
117 const std::filesystem::path &source,
118 const std::string_view media_type,
119 const MetapackEncoding encoding,
120 const std::span<const std::uint8_t> extension = {})
121 -> void;
122
123} // namespace sourcemeta::core
124
125#endif
Definition json_value.h:39
SOURCEMETA_CORE_METAPACK_EXPORT auto metapack_write_bytes(const std::filesystem::path &destination, const std::span< const std::uint8_t > contents, const std::string_view media_type, const MetapackEncoding encoding, const std::span< const std::uint8_t > extension={}) -> void
MetapackEncoding
Definition metapack_format.h:23
SOURCEMETA_CORE_METAPACK_EXPORT auto metapack_write_json_pretty(const std::filesystem::path &destination, const JSON &document, const std::string_view media_type, const MetapackEncoding encoding, const std::span< const std::uint8_t > extension={}) -> void
SOURCEMETA_CORE_METAPACK_EXPORT auto metapack_write_file(const std::filesystem::path &destination, const std::filesystem::path &source, const std::string_view media_type, const MetapackEncoding encoding, const std::span< const std::uint8_t > extension={}) -> void
SOURCEMETA_CORE_METAPACK_EXPORT auto metapack_write_text(const std::filesystem::path &destination, const std::string_view contents, const std::string_view media_type, const MetapackEncoding encoding, const std::span< const std::uint8_t > extension={}) -> void
SOURCEMETA_CORE_METAPACK_EXPORT auto metapack_write_json(const std::filesystem::path &destination, const JSON &document, const std::string_view media_type, const MetapackEncoding encoding, const std::span< const std::uint8_t > extension={}) -> void