1 //===-- MICmnStreamStdout.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: MICmnStreamStdout.h
13 // Overview: CMICmnStreamStdout interface.
15 // Environment: Compilers: Visual C++ 12.
16 // gcc (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
17 // Libraries: See MIReadmetxt.
25 #include "MIUtilString.h"
26 #include "MICmnBase.h"
27 #include "MIUtilThreadBaseStd.h"
28 #include "MIUtilSingletonBase.h"
30 //++ ============================================================================
31 // Details: MI common code class. The MI driver requires this object.
32 // CMICmnStreamStdout sets up and tears downs stdout for the driver.
36 // Authors: Illya Rudkin 12/02/2014.
39 class CMICmnStreamStdout
41 , public MI::ISingleton< CMICmnStreamStdout >
43 friend class MI::ISingleton< CMICmnStreamStdout >;
47 static bool TextToStdout( const CMIUtilString & vrTxt );
51 bool Initialize( void );
52 bool Shutdown( void );
56 bool Write( const CMIUtilString & vText, const bool vbSendToLog = true );
57 bool WriteMIResponse( const CMIUtilString & vText, const bool vbSendToLog = true );
61 /* ctor */ CMICmnStreamStdout( void );
62 /* ctor */ CMICmnStreamStdout( const CMICmnStreamStdout & );
63 void operator=( const CMICmnStreamStdout & );
65 bool WritePriv( const CMIUtilString & vText, const CMIUtilString & vTxtForLogFile, const bool vbSendToLog = true );
70 /* dtor */ virtual ~CMICmnStreamStdout( void );
74 CMIUtilThreadMutex m_mutex; // Mutex object for sync during writing to stream