cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
print.hpp File Reference
#include <algorithm>
#include <array>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "cpp-toolbox/base/env.hpp"
#include "cpp-toolbox/cpp-toolbox_export.hpp"
#include "cpp-toolbox/macro.hpp"
#include "cpp-toolbox/type_traits.hpp"
Include dependency graph for print.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  toolbox::utils::print_style_t
 打印风格设置/Print style settings More...
 
struct  toolbox::utils::print_style_t::box_chars_t
 
class  toolbox::utils::color_handler_t
 平台无关的颜色处理类/Platform-independent color handler More...
 
class  toolbox::utils::table_t
 格式化打印表格工具/Formatted table printing utility More...
 
class  toolbox::utils::container_printer_t< Container >
 通用容器打印器基类/Generic container printer base class More...
 
class  toolbox::utils::vector_printer_t< T >
 Vector 打印器/Vector printer. More...
 
class  toolbox::utils::map_printer_t< K, V >
 Map 打印器/Map printer. More...
 
class  toolbox::utils::unorderedmap_printer_t< K, V >
 Unordered Map 打印器/Unordered map printer. More...
 
class  toolbox::utils::set_printer_t< T >
 Set 打印器/Set printer. More...
 
class  toolbox::utils::unorderedset_printer_t< T >
 Unordered Set 打印器/Unordered set printer. More...
 
class  toolbox::utils::deque_printer_t< T >
 Deque 打印器/Deque printer. More...
 
class  toolbox::utils::list_printer_t< T >
 List 打印器/List printer. More...
 
class  toolbox::utils::array_printer_t< T, N >
 Array 打印器/Array printer. More...
 
class  toolbox::utils::queue_printer_t< T >
 队列打印器/Queue printer More...
 

Namespaces

namespace  toolbox
 
namespace  toolbox::utils
 < 用于 std::out_of_range/For std::out_of_range
 

Functions

auto toolbox::utils::get_default_style () -> const print_style_t &
 获取默认打印风格/Get default print style
 
auto toolbox::utils::get_ascii_style () -> const print_style_t &
 获取 ASCII 风格的表格边框/Get ASCII style table borders
 
auto toolbox::utils::get_rounded_style () -> const print_style_t &
 获取圆角边框风格/Style using Unicode box drawing characters
 
template<typename T >
auto toolbox::utils::to_string_value (const T &value) -> std::string
 获取字符串表示形式的通用函数/Generic function to get string representation
 
auto toolbox::utils::align_text (const std::string &text, size_t width, align_t align, const std::string &padding=" ") -> std::string
 处理对齐功能/Handle text alignment
 
CPP_TOOLBOX_EXPORT std::ostream & toolbox::utils::operator<< (std::ostream &os, const table_t &tbl)
 
template<typename Container >
auto toolbox::utils::operator<< (std::ostream &os, const container_printer_t< Container > &printer) -> std::ostream &
 输出容器 / Output container
 
template<typename T >
auto toolbox::utils::print_vector (const std::vector< T > &vec, const std::string &name="Vector", const print_style_t &style=get_default_style()) -> vector_printer_t< T >
 打印vector的工厂函数/Factory function to print vector
 
template<typename K , typename V >
auto toolbox::utils::print_map (const std::map< K, V > &m, const std::string &name="Map", const print_style_t &style=get_default_style()) -> map_printer_t< K, V >
 打印map的工厂函数/Factory function to print map
 
template<typename K , typename V >
auto toolbox::utils::print_unordered_map (const std::unordered_map< K, V > &m, const std::string &name="Unordered Map", const print_style_t &style=get_default_style()) -> unorderedmap_printer_t< K, V >
 打印unordered_map的工厂函数/Factory function to print unordered_map
 
template<typename T >
auto toolbox::utils::print_set (const std::set< T > &s, const std::string &name="Set", const print_style_t &style=get_default_style()) -> set_printer_t< T >
 打印set的工厂函数/Factory function to print set
 
template<typename T >
auto toolbox::utils::print_unordered_set (const std::unordered_set< T > &s, const std::string &name="Unordered Set", const print_style_t &style=get_default_style()) -> unorderedset_printer_t< T >
 打印unordered_set的工厂函数/Factory function to print unordered_set
 
template<typename T >
auto toolbox::utils::print_deque (const std::deque< T > &d, const std::string &name="Deque", const print_style_t &style=get_default_style()) -> deque_printer_t< T >
 打印deque的工厂函数/Factory function to print deque
 
template<typename T >
auto toolbox::utils::print_list (const std::list< T > &l, const std::string &name="List", const print_style_t &style=get_default_style()) -> list_printer_t< T >
 打印list的工厂函数/Factory function to print list
 
template<typename T , size_t N>
auto toolbox::utils::print_array (const std::array< T, N > &arr, const std::string &name="Array", const print_style_t &style=get_default_style()) -> array_printer_t< T, N >
 打印array的工厂函数/Factory function to print array
 
template<typename T >
auto toolbox::utils::print_queue (const std::queue< T > &q, const std::string &name="Queue", const print_style_t &style=get_default_style()) -> queue_printer_t< T >
 打印queue的工厂函数/Factory function to print queue
 

Variables

enum CPP_TOOLBOX_EXPORT toolbox::utils::align_t
 左对齐/Left align
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::RIGHT
 右对齐/Right align
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::CENTER
 < 居中对齐/Center align
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::color_t
 默认颜色/Default color
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::BLACK
 黑色/Black
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::RED
 红色/Red
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::GREEN
 绿色/Green
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::YELLOW
 黄色/Yellow
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::BLUE
 蓝色/Blue
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::MAGENTA
 品红/Magenta
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::CYAN
 青色/Cyan
 
enum CPP_TOOLBOX_EXPORT toolbox::utils::WHITE
 < 白色/White
 
class CPP_TOOLBOX_EXPORT toolbox::utils::table_t