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
21{
24
25enum class TextColor
26{
27 GREEN,
28 RED,
29 YELLOW,
30 BLUE,
31 MAGENTA,
32 CYAN
33};
34
47std::vector<std::string> splitString(const std::string& str, const std::string& delimiter, bool preserve_empty = true);
48
59std::string makeColoredText(const std::string& text, TextColor color);
60
62} // namespace auto_apms_core::util
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
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