AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
string.hpp
Go to the documentation of this file.
1
// Copyright 2024 Robin Müller
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// https://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#pragma once
16
17
#include <string>
18
#include <vector>
19
20
namespace
auto_apms_core::util
21
{
24
25
enum class
TextColor
26
{
27
GREEN
,
28
RED
,
29
YELLOW
,
30
BLUE
,
31
MAGENTA
,
32
CYAN
33
};
34
47
std::vector<std::string>
splitString
(
const
std::string& str,
const
std::string& delimiter,
bool
preserve_empty =
true
);
48
59
std::string
makeColoredText
(
const
std::string& text,
TextColor
color);
60
62
}
// namespace auto_apms_core::util
auto_apms_core::util::makeColoredText
std::string makeColoredText(const std::string &text, TextColor color)
Add ANSI color escape sequences to display the text in color when printed to console.
Definition
string.cpp:45
auto_apms_core::util::splitString
std::vector< std::string > splitString(const std::string &str, const std::string &delimiter, bool preserve_empty=true)
Split a string into multiple tokens using a specific delimiter string (Delimiter may consist of multi...
Definition
string.cpp:24
auto_apms_core::util::TextColor
TextColor
Definition
string.hpp:26
auto_apms_core::util::TextColor::BLUE
@ BLUE
auto_apms_core::util::TextColor::CYAN
@ CYAN
auto_apms_core::util::TextColor::YELLOW
@ YELLOW
auto_apms_core::util::TextColor::GREEN
@ GREEN
auto_apms_core::util::TextColor::RED
@ RED
auto_apms_core::util::TextColor::MAGENTA
@ MAGENTA
auto_apms_core::util
Definition
string.hpp:21
auto_apms_core
include
auto_apms_core
util
string.hpp
Generated by
1.12.0