ChimeraTK-ApplicationCore 04.06.00
Loading...
Searching...
No Matches
Utilities.h
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#pragma once
4
5#include <string>
6
8
16 std::string getUnqualifiedName(const std::string& qualifiedName);
17
25 std::string getPathName(const std::string& qualifiedName);
26
33 std::string escapeName(const std::string& name, bool allowDotsAndSlashes);
34
38 std::string unescapeName(const std::string& name_stripped);
39
44 bool checkName(const std::string& name, bool allowDotsAndSlashes);
45
52 void setThreadName(const std::string& name);
53
58 std::string raiseIftrailingSlash(const std::string& name, bool isModule);
59
63 bool isBeingDebugged();
64
65} // namespace ChimeraTK::Utilities
std::string raiseIftrailingSlash(const std::string &name, bool isModule)
Raises logic error if name ends in a slash, or if it contains consecutive slashes.
Definition Utilities.cc:117
bool checkName(const std::string &name, bool allowDotsAndSlashes)
Check given name for characters which are not allowed in variable or module names.
Definition Utilities.cc:88
std::string escapeName(const std::string &name, bool allowDotsAndSlashes)
Convert all characters which are not allowed in variable or module names into underscores followed by...
Definition Utilities.cc:45
std::string getPathName(const std::string &qualifiedName)
Return all but the last components of the given qualified name.
Definition Utilities.cc:29
void setThreadName(const std::string &name)
Set name of the current thread.
Definition Utilities.cc:105
std::string getUnqualifiedName(const std::string &qualifiedName)
Return the last component of the given qualified path name.
Definition Utilities.cc:19
bool isBeingDebugged()
Checks whether the current process is being debugged.
Definition Utilities.cc:132
std::string unescapeName(const std::string &name_stripped)
Undo the escaping done by escapeName().
Definition Utilities.cc:71