]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/MIUtilFileStd.h
Merge ^/head r275478 through r275622.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / MIUtilFileStd.h
1 //===-- MIUtilFileStd.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:                MIUtilFileStd.h
12 //
13 // Overview:    CMIUtilFileStd 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 "MIUtilString.h"  
26 #include "MICmnBase.h"
27
28 //++ ============================================================================
29 // Details:     MI common code utility class. File handling.
30 // Gotchas:     None.
31 // Authors:     Aidan Dodds 10/03/2014.
32 // Changes:     None.
33 //--
34 class CMIUtilFileStd : public CMICmnBase
35 {
36 // Static:
37 public:
38         static MIchar   GetSlash( void );
39
40 // Methods:
41 public:
42         /* ctor */  CMIUtilFileStd( void );
43         //      
44         bool                                    CreateWrite( const CMIUtilString & vFileNamePath, bool & vwrbNewCreated );
45         bool                                    Write( const CMIUtilString & vData );
46         bool                                    Write( const MIchar * vpData, const MIuint vCharCnt );
47         void                                    Close( void );
48         bool                                    IsOk( void ) const;
49         bool                                    IsFileExist( const CMIUtilString & vFileNamePath ) const;
50         const CMIUtilString &   GetLineReturn( void ) const;
51         CMIUtilString                   StripOffFileName( const CMIUtilString & vDirectoryPath ) const;
52
53 // Overridden:
54 public:
55         // From CMICmnBase
56         /* dtor */ virtual ~CMIUtilFileStd( void );
57         
58 // Attributes:
59 private:
60         CMIUtilString   m_fileNamePath;
61         FILE *                  m_pFileHandle;
62         CMIUtilString   m_constCharNewLine;
63         bool                    m_bFileError;           // True = have a file error ATM, false = all ok
64 };
65