EHS
Console.h
Go to the documentation of this file.
1#pragma once
2
3#include "ehs/Str.h"
4#include "ehs/UTF.h"
5#include "ehs/Array.h"
6
7namespace ehs
8{
9 #if defined(EHS_OS_WINDOWS)
10 typedef void* ConsoleHdl;
11 #elif defined(EHS_OS_LINUX)
12 typedef int ConsoleHdl;
13 #endif
14
15 class EHS_LIB_IO Console
16 {
17 private:
18 static ConsoleHdl hdlOut;
19 static ConsoleHdl hdlIn;
20
21 #if defined(EHS_OS_WINDOWS)
22 static bool isConsole;
23 #endif
24
25 public:
26 static void Attach();
27
30 static bool Create();
31
33 static void Free();
34
35 static bool CanRead();
36
37 static bool CanWrite();
38
43 static void Write_32(const Str_32& str, const bool newLine = true);
44
48 static void Write_16(const Str_16& str, const bool newLine = true);
49
54 static void Write_8(const Str_8& str, const bool newLine = true);
55
59 static Str_32 Read_32(const UInt_64 bufferSize = 1024);
60
63 static Str_16 Read_16(const UInt_64 bufferSize = 1024);
64
68 static Str_8 Read_8(const UInt_64 bufferSize = 1024);
69
71 static void Clear();
72
76 static void SetTitle_32(const Str_32& title);
77
80 static void SetTitle_16(const Str_16& title);
81
85 static void SetTitle_8(const Str_8& title);
86
90 static Str_32 GetTitle_32();
91
94 static Str_16 GetTitle_16();
95
99 static Str_8 GetTitle_8();
100
103 static Vector<Str_32> GetArgs_32(const UInt_64 bufferSize = 1024);
104
107 static Vector<Str_16> GetArgs_16(const UInt_64 bufferSize = 1024);
108
111 static Vector<Str_8> GetArgs_8(const UInt_64 bufferSize = 1024);
112
113 //static void* GetHandle();
114 };
115}
Definition: Console.h:16
Definition: Str.h:29
Definition: Vector.h:18
Definition: Anchor.h:6