Blender V4.5
BKE_path_templates.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10#pragma once
11
12#include <cmath>
13#include <optional>
14
15#include "BLI_map.hh"
16#include "BLI_path_utils.hh"
17#include "BLI_string.h"
18#include "BLI_string_ref.hh"
19#include "BLI_string_utils.hh"
20
21#include "BKE_report.hh"
22
23#include "DNA_scene_types.h"
24
25struct bContext;
26struct PointerRNA;
27struct PropertyRNA;
28
30
46
47 public:
51 bool contains(blender::StringRef name) const;
52
59 bool remove(blender::StringRef name);
60
71
81 bool add_integer(blender::StringRef name, int64_t value);
82
92 bool add_float(blender::StringRef name, double value);
93
100 std::optional<blender::StringRefNull> get_string(blender::StringRef name) const;
101
108 std::optional<int64_t> get_integer(blender::StringRef name) const;
109
116 std::optional<double> get_float(blender::StringRef name) const;
117};
118
125
130
131bool operator==(const Error &left, const Error &right);
132
133} // namespace blender::bke::path_templates
134
147std::optional<blender::bke::path_templates::VariableMap> BKE_build_template_variables_for_prop(
148 const bContext *C, PointerRNA *ptr, PropertyRNA *prop);
149
177 const RenderData *render_data);
178
190
203 blender::StringRef path, const blender::bke::path_templates::VariableMap &template_variables);
204
245 char *path,
246 int path_max_length,
247 const blender::bke::path_templates::VariableMap &template_variables);
252 blender::StringRef path);
253
259 eReportType report_type,
262
269std::optional<std::string> BKE_path_template_format_float(blender::StringRef format_specifier,
270 double value);
271
273std::optional<std::string> BKE_path_template_format_int(blender::StringRef format_specifier,
274 int64_t value);
void BKE_report_path_template_errors(ReportList *reports, eReportType report_type, blender::StringRef path, blender::Span< blender::bke::path_templates::Error > errors)
std::optional< blender::bke::path_templates::VariableMap > BKE_build_template_variables_for_prop(const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
std::optional< std::string > BKE_path_template_format_int(blender::StringRef format_specifier, int64_t value)
std::optional< std::string > BKE_path_template_format_float(blender::StringRef format_specifier, double value)
std::string BKE_path_template_error_to_string(const blender::bke::path_templates::Error &error, blender::StringRef path)
blender::bke::path_templates::VariableMap BKE_build_template_variables_for_render_path(const RenderData *render_data)
blender::Vector< blender::bke::path_templates::Error > BKE_path_validate_template(blender::StringRef path, const blender::bke::path_templates::VariableMap &template_variables)
bool BKE_path_contains_template_syntax(blender::StringRef path)
#define C
Definition RandGen.cpp:29
ReportList * reports
Definition WM_types.hh:1025
long long int int64_t
std::optional< blender::StringRefNull > get_string(blender::StringRef name) const
std::optional< int64_t > get_integer(blender::StringRef name) const
bool add_string(blender::StringRef name, blender::StringRef value)
bool contains(blender::StringRef name) const
bool add_float(blender::StringRef name, double value)
bool remove(blender::StringRef name)
bool add_integer(blender::StringRef name, int64_t value)
std::optional< double > get_float(blender::StringRef name) const
static int left
static void error(const char *str)
bool operator==(const Error &left, const Error &right)
blender::Vector< Error > BKE_path_apply_template(char *path, int path_max_length, const VariableMap &template_variables)
PointerRNA * ptr
Definition wm_files.cc:4226