ObjFW
OFStdIOStream.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017
3  * Jonathan Schleifer <js@heap.zone>
4  *
5  * All rights reserved.
6  *
7  * This file is part of ObjFW. It may be distributed under the terms of the
8  * Q Public License 1.0, which can be found in the file LICENSE.QPL included in
9  * the packaging of this file.
10  *
11  * Alternatively, it may be distributed under the terms of the GNU General
12  * Public License, either version 2 or 3, which can be found in the file
13  * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
14  * file.
15  */
16 
17 #import "OFStream.h"
18 
19 #ifdef OF_MORPHOS
20 # define BOOL EXEC_BOOL
21 # include <proto/dos.h>
22 # undef BOOL
23 #endif
24 
25 OF_ASSUME_NONNULL_BEGIN
26 
35 #ifdef OF_STDIO_STREAM_WIN32_CONSOLE_H
36 OF_SUBCLASSING_RESTRICTED
37 #endif
39 {
40 #ifndef OF_MORPHOS
41  int _fd;
42 #else
43  BPTR _handle;
44  bool _closable;
45 #endif
46  bool _atEndOfStream;
47 }
48 
49 - init OF_UNAVAILABLE;
50 
57 - (int)columns;
58 
65 - (int)rows;
66 @end
67 
68 #ifdef __cplusplus
69 extern "C" {
70 #endif
71 
76 extern OFStdIOStream *_Nullable of_stdin;
77 
81 extern OFStdIOStream *_Nullable of_stdout;
82 
86 extern OFStdIOStream *_Nullable of_stderr;
87 
88 extern void of_log(OFConstantString *, ...);
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 OF_ASSUME_NONNULL_END
int rows()
Query the underlying terminal for the number of rows.
Definition: OFStdIOStream.m:336
A class for providing standard input, output and error as OFStream.
Definition: OFStdIOStream.h:38
id init()
Initializes an already allocated object.
Definition: OFObject.m:488
int columns()
Query the underlying terminal for the number of columns.
Definition: OFStdIOStream.m:322
OFStdIOStream *_Nullable of_stdin
The standard input as an OFStream.
Definition: OFStdIOStream.m:58
OFStdIOStream *_Nullable of_stderr
The standard error as an OFStream.
Definition: OFStdIOStream.m:60
A class for storing constant strings using the @"" literal.
Definition: OFConstantString.h:37
A base class for different types of streams.
Definition: OFStream.h:88
OFStdIOStream *_Nullable of_stdout
The standard output as an OFStream.
Definition: OFStdIOStream.m:59