Blender V4.3
spreadsheet_column_values.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "DNA_space_types.h"
8
10#include "BLI_string_ref.hh"
11
13
15
20class ColumnValues final {
21 protected:
22 std::string name_;
23
25
26 public:
27 ColumnValues(std::string name, GVArray data) : name_(std::move(name)), data_(std::move(data))
28 {
29 /* The array should not be empty. */
31 }
32
33 virtual ~ColumnValues() = default;
34
39
41 {
42 return name_;
43 }
44
45 int size() const
46 {
47 return data_.size();
48 }
49
50 const GVArray &data() const
51 {
52 return data_;
53 }
54
55 /* The default width of newly created columns, in UI units. */
56 float default_width = 0.0f;
57};
58
59} // namespace blender::ed::spreadsheet
#define BLI_assert(a)
Definition BLI_assert.h:50
eSpreadsheetColumnValueType
eSpreadsheetColumnValueType type() const
eSpreadsheetColumnValueType cpp_type_to_column_type(const CPPType &type)