Blender V5.0
description.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "description.hh"
6
7#include "BLI_utildefines.h"
8
9namespace blender::ocio {
10
11std::string cleanup_description(const StringRef description)
12{
13 if (description.is_empty()) {
14 return "";
15 }
16
17 std::string result = description.trim("\r\n");
18
19 for (char &ch : result) {
20 if (ELEM(ch, '\r', '\n')) {
21 ch = ' ';
22 }
23 }
24
25 return result;
26}
27
28} // namespace blender::ocio
#define ELEM(...)
constexpr bool is_empty() const
constexpr StringRef trim() const
std::string cleanup_description(const StringRef description)