]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MICmnStreamStdinLinux.h
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[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 : public CMICmnBase, public CMICmnStreamStdin::IOSStdinHandler, public MI::ISingleton<CMICmnStreamStdinLinux>
40 {
41     // Give singleton access to private constructors
42     friend MI::ISingleton<CMICmnStreamStdinLinux>;
43
44     // Methods:
45   public:
46     bool Initialize(void);
47     bool Shutdown(void);
48
49     // Overridden:
50   public:
51     // From CMICmnStreamStdin::IOSpecificReadStreamStdin
52     virtual bool InputAvailable(bool &vwbAvail);
53     virtual const MIchar *ReadLine(CMIUtilString &vwErrMsg);
54     virtual void InterruptReadLine(void);
55
56     // Methods:
57   private:
58     /* ctor */ CMICmnStreamStdinLinux(void);
59     /* ctor */ CMICmnStreamStdinLinux(const CMICmnStreamStdin &);
60     void operator=(const CMICmnStreamStdin &);
61
62     // Overridden:
63   private:
64     // From CMICmnBase
65     /* dtor */ virtual ~CMICmnStreamStdinLinux(void);
66
67     // Attributes:
68   private:
69     const MIuint m_constBufferSize;
70     FILE *m_pStdin;
71     MIchar *m_pCmdBuffer;
72 };