libsemigroups  v3.1.2
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
print.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2025 James D. Mitchell
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18#ifndef LIBSEMIGROUPS_DETAIL_PRINT_HPP_
19#define LIBSEMIGROUPS_DETAIL_PRINT_HPP_
20
21#include <string> // for basic_string
22#include <vector> // for vector
23
24#include "fmt.hpp"
25
26namespace libsemigroups {
27 namespace detail {
28 [[nodiscard]] bool isprint(std::string const& alphabet);
29
30 [[nodiscard]] std::string to_printable(char c);
31
32 [[nodiscard]] std::string to_printable(std::string const& alphabet);
33
34 template <typename Int>
35 [[nodiscard]] std::string
36 to_printable(std::basic_string<Int> const& alphabet) {
37 return fmt::format("{}",
38 std::vector<int>(alphabet.begin(), alphabet.end()));
39 }
40
41 template <typename Thing>
42 [[nodiscard]] std::string to_printable(Thing const& thing) {
43 return fmt::format("{}", thing);
44 }
45 } // namespace detail
46} // namespace libsemigroups
47
48#endif // LIBSEMIGROUPS_DETAIL_PRINT_HPP_
T begin(T... args)
T end(T... args)
Namespace for everything in the libsemigroups library.
Definition action.hpp:44