ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
VisitorHelper.cc
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Deutsches Elektronen-Synchrotron DESY, MSK, ChimeraTK Project <chimeratk-support@desy.de>
2// SPDX-License-Identifier: LGPL-3.0-or-later
3#include "VisitorHelper.h"
4
6
7namespace ChimeraTK::detail {
8
9 /********************************************************************************************************************/
10
11 std::string encodeDotNodeName(std::string name) {
12 std::replace(name.begin(), name.end(), '-', 'm'); // minus
13 std::replace(name.begin(), name.end(), ':', 'c'); // colon
14 std::replace(name.begin(), name.end(), '/', 's'); // slash
15 std::replace(name.begin(), name.end(), '.', 'd'); // dot
16 std::replace(name.begin(), name.end(), ' ', '_'); // Generic space replacer
17 std::replace(name.begin(), name.end(), '*', 'a'); // asterisk
18 std::replace(name.begin(), name.end(), '@', 'A'); // at
19
20 return name;
21 }
22
23 /********************************************************************************************************************/
24
25 std::string nodeName(const VariableNetworkNode& node) {
26 return node.getQualifiedName().empty() ? node.getName() : node.getQualifiedName();
27 }
28
29 /********************************************************************************************************************/
30
31} // namespace ChimeraTK::detail