]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmnStreamStdinLinux.h
Merge ^/head r275118 through r275209.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MICmnStreamStdinLinux.h
1 //===-- MICmnStreamStdinWindows.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 //++
11 // File:                MIUtilStreamStdin.h
12 //
13 // Overview:    CMICmnStreamStdinLinux interface.
14 //
15 // Environment: Compilers:      Visual C++ 12.
16 //                                                      gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 //                              Libraries:      See MIReadmetxt. 
18 //
19 // Copyright:   None.
20 //--
21
22 #pragma once
23
24 // In-house headers:
25 #include "MICmnBase.h"
26 #include "MICmnStreamStdin.h"
27 #include "MIUtilSingletonBase.h"
28
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.
35 // Gotchas:     None.
36 // Authors:     Illya Rudkin 16/06/2014.
37 // Changes:     None.
38 //--
39 class CMICmnStreamStdinLinux
40 :       public CMICmnBase
41 ,       public CMICmnStreamStdin::IOSStdinHandler
42 ,       public MI::ISingleton< CMICmnStreamStdinLinux >
43 {
44         // Give singleton access to private constructors
45         friend MI::ISingleton< CMICmnStreamStdinLinux >;
46
47 // Methods:
48 public:
49         bool    Initialize( void );
50         bool    Shutdown( void );
51
52 // Overridden:
53 public:
54         // From CMICmnStreamStdin::IOSpecificReadStreamStdin
55         virtual bool                    InputAvailable( bool & vwbAvail );
56         virtual const MIchar *  ReadLine( CMIUtilString & vwErrMsg );
57         
58 // Methods:
59 private:
60         /* ctor */      CMICmnStreamStdinLinux( void );
61         /* ctor */      CMICmnStreamStdinLinux( const CMICmnStreamStdin & );
62         void            operator=( const CMICmnStreamStdin & );
63
64 // Overridden:
65 private:
66         // From CMICmnBase
67         /* dtor */ virtual ~CMICmnStreamStdinLinux( void );
68
69 // Attributes:
70 private:
71         const MIuint    m_constBufferSize;
72         FILE *                  m_pStdin;
73         MIchar *                m_pCmdBuffer;
74 };
75