1 //===-- MICmnStreamStdinWindows.h --------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
11 // File: MIUtilStreamStdin.h
13 // Overview: CMICmnStreamStdinLinux interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
25 #include "MICmnBase.h"
26 #include "MICmnStreamStdin.h"
27 #include "MIUtilSingletonBase.h"
29 //++ ============================================================================
30 // Details: MI common code class. Specific OS stdin handling implementation.
31 // CMICmnStreamStdin instance is set with stdin handler before using the
32 // the stream. An instance of this class must be set up and ready to give
33 // to the CMICmnStreamStdin before it initialises other CMICmnStreamStdin
34 // will give an error.
36 // Authors: Illya Rudkin 16/06/2014.
39 class CMICmnStreamStdinLinux
41 , public CMICmnStreamStdin::IOSStdinHandler
42 , public MI::ISingleton< CMICmnStreamStdinLinux >
44 // Give singleton access to private constructors
45 friend MI::ISingleton< CMICmnStreamStdinLinux >;
49 bool Initialize( void );
50 bool Shutdown( void );
54 // From CMICmnStreamStdin::IOSpecificReadStreamStdin
55 virtual bool InputAvailable( bool & vwbAvail );
56 virtual const MIchar * ReadLine( CMIUtilString & vwErrMsg );
60 /* ctor */ CMICmnStreamStdinLinux( void );
61 /* ctor */ CMICmnStreamStdinLinux( const CMICmnStreamStdin & );
62 void operator=( const CMICmnStreamStdin & );
67 /* dtor */ virtual ~CMICmnStreamStdinLinux( void );
71 const MIuint m_constBufferSize;
73 MIchar * m_pCmdBuffer;