Blender  V3.3
BKE_idprop.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #pragma once
4 
5 #include "BKE_idprop.h"
6 
7 #include "BLI_serialize.hh"
8 #include "BLI_span.hh"
9 
11 
19 std::unique_ptr<io::serialize::ArrayValue> convert_to_serialize_values(
20  const IDProperty *properties);
21 
26 
28  public:
29  void operator()(IDProperty *id_prop)
30  {
31  IDP_FreeProperty(id_prop);
32  }
33 };
34 
36 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name, int32_t value);
37 
39 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name, float value);
40 
42 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name, double value);
43 
45 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name,
46  const StringRefNull value);
47 
53 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name,
54  Span<int32_t> values);
55 
61 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name, Span<float> values);
62 
68 std::unique_ptr<IDProperty, IDPropertyDeleter> create(StringRefNull prop_name,
69  Span<double> values);
70 
77 std::unique_ptr<IDProperty, IDPropertyDeleter> create_group(StringRefNull prop_name);
78 
79 } // namespace blender::bke::idprop
void IDP_FreeProperty(struct IDProperty *prop)
Definition: idprop.c:1093
void operator()(IDProperty *id_prop)
Definition: BKE_idprop.hh:29
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRefNull prop_name)
Allocate a new IDProperty of type IDP_GROUP.
std::unique_ptr< io::serialize::ArrayValue > convert_to_serialize_values(const IDProperty *properties)
Convert the given properties to Value objects for serialization.
std::unique_ptr< IDProperty, IDPropertyDeleter > create(StringRefNull prop_name, int32_t value)
Allocate a new IDProperty of type IDP_INT, set its name and value.
IDProperty * convert_from_serialize_value(const blender::io::serialize::Value &value)
Convert the given value to an IDProperty.
signed int int32_t
Definition: stdint.h:77