SeqAn3
3.1.0
The Modern C++ library for sequence analysis.
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
terminal.hpp
Go to the documentation of this file.
1
// -----------------------------------------------------------------------------------------------------
2
// Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
3
// Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
4
// This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
5
// shipped with this file and also available at: https://github.com/seqan/seqan3/blob/master/LICENSE.md
6
// -----------------------------------------------------------------------------------------------------
7
14
#pragma once
15
16
#ifndef _WIN32
17
# include <sys/ioctl.h>
18
#else
19
# include <windows.h>
20
#endif
21
22
#include <unistd.h>
23
24
#include <
cstdio
>
25
26
#include <
seqan3/core/platform.hpp
>
27
28
namespace
seqan3::detail
29
{
30
31
// ----------------------------------------------------------------------------
32
// Function is_terminal()
33
// ----------------------------------------------------------------------------
34
38
inline
bool
is_terminal()
39
{
40
#ifndef _WIN32
41
return
isatty(STDOUT_FILENO);
42
#else
43
return
false
;
44
#endif
45
}
46
47
// ----------------------------------------------------------------------------
48
// Function get_terminal_size()
49
// ----------------------------------------------------------------------------
50
60
inline
unsigned
get_terminal_width()
61
{
62
#ifndef _WIN32
63
64
struct
winsize w;
65
w.ws_row = 0;
66
w.ws_col = 0;
67
68
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
69
70
return
w.ws_col;
71
#else
72
return
80;
// not implemented in windows
73
#endif
74
}
75
76
}
// namespace seqan::detail
cstdio
platform.hpp
Provides platform and dependency checks.
Version:
main_user
main_dev
3.4.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.2
3.0.1
3.0.0
seqan3
argument_parser
detail
terminal.hpp
Generated on Thu Nov 11 2021 09:23:13 for SeqAn3 by
1.9.2