Leonardus
Loading...
Searching...
No Matches
io.h
Go to the documentation of this file.
1
17#pragma once
18
19// Inc Library
20#include <string_view>
21#include <string>
22
23
25namespace io {
26
29 int nof();
30
31
36 inline bool validmode( const std::string & p_str ) {
37 return p_str == "r" ||
38 p_str == "w" ||
39 p_str == "a" ||
40 p_str == "r+" ||
41 p_str == "w+" ||
42 p_str == "a+";
43 }
44
45
47 constexpr std::string_view AEC_FGCOL_RESET = "\x1b[39m";
48
49
51 constexpr std::string_view AEC_BGCOL_RESET = "\x1b[49m";
52
53
55 constexpr std::string_view AEC_FGCOL_HEADER = "\x1b[33m";
56
57
59 constexpr std::string_view AEC_FGCOL_DICTVALUE = "\x1b[93m";
60
61
63 constexpr std::string_view AEC_BGCOL_LIST = "\x1b[48;5;238m";
64
65} // namespace io
Collection of low level IO helpers.
Definition io.h:25
constexpr std::string_view AEC_FGCOL_DICTVALUE
ANSI escape code foreground color for dictionary values.
Definition io.h:59
constexpr std::string_view AEC_BGCOL_LIST
ANSI escape code background color for lists.
Definition io.h:63
constexpr std::string_view AEC_FGCOL_RESET
ANSI escape code foreground color reset.
Definition io.h:47
bool validmode(const std::string &p_str)
Checks if p_str is one of: r,w,a,r+,w,a+ .
Definition io.h:36
constexpr std::string_view AEC_FGCOL_HEADER
ANSI escape code foreground color for headers.
Definition io.h:55
constexpr std::string_view AEC_BGCOL_RESET
ANSI escape code background color reset.
Definition io.h:51
int nof()
Look up number of open files with fcntl().
Definition io.cpp:26