ALib C++ Library
by
Library Version:
2402 R1
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
lang
system
console.hpp
Go to the documentation of this file.
1
/** ************************************************************************************************
2
* \file
3
* This header file is part of sub-namespace # alib::lang::system of module \alib_basecamp of
4
* the \aliblong.
5
*
6
* \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
7
* Published under \ref mainpage_license "Boost Software License".
8
**************************************************************************************************/
9
#ifndef HPP_ALIB_LANG_CONSOLE
10
#define HPP_ALIB_LANG_CONSOLE 1
11
12
#if !defined(HPP_ALIB) && !defined(ALIB_DOX)
13
# include "
alib/alib.hpp
"
14
#endif
15
16
ALIB_ASSERT_MODULE
(CAMP)
17
18
19
namespace
alib
{
namespace
lang::system {
20
21
/** ************************************************************************************************
22
* This class provides system dependent features in respect the console attached to a process.
23
**************************************************************************************************/
24
class
Console
25
{
26
protected
:
27
/** Console text width. */
28
ALIB_API
static
29
int
lastReceivedWidth
;
30
31
public
:
32
/** ****************************************************************************************
33
* Tries to detect the current width of the console. Returns \c 0 in case of failure.
34
*
35
* @param forceRedetect If \c true, the console size is tried to be detected, even if it
36
* had been done before (and even if it failed before).<br>
37
* Defaults to \c false.
38
*
39
* @return The console width.
40
******************************************************************************************/
41
ALIB_API
static
42
int
GetWidth
(
bool
forceRedetect =
false
);
43
};
44
45
}
// namespace alib[:: lang::system]
46
47
/// Type alias in namespace \b alib.
48
using
Console
=
lang::system::Console
;
49
50
}
// namespace [alib]
51
52
#endif
// HPP_ALIB_LANG_CONSOLE
alib.hpp
alib::lang::system::Console
Definition
console.hpp:25
alib::lang::system::Console::GetWidth
static ALIB_API int GetWidth(bool forceRedetect=false)
Definition
console.cpp:38
alib::lang::system::Console::lastReceivedWidth
static ALIB_API int lastReceivedWidth
Definition
console.hpp:29
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.hpp:190
ALIB_API
#define ALIB_API
Definition
alib.hpp:538
alib
Definition
alib.cpp:57