Files
clang-p2996/lldb/tools/lldb-mi/MICmnLogMediumFile.h
Kate Stone b9c1b51e45 *** This commit represents a complete reformatting of the LLDB source code
*** to conform to clang-format’s LLVM style.  This kind of mass change has
*** two obvious implications:

Firstly, merging this particular commit into a downstream fork may be a huge
effort.  Alternatively, it may be worth merging all changes up to this commit,
performing the same reformatting operation locally, and then discarding the
merge for this particular commit.  The commands used to accomplish this
reformatting were as follows (with current working directory as the root of
the repository):

    find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} +
    find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ;

The version of clang-format used was 3.9.0, and autopep8 was 1.2.4.

Secondly, “blame” style tools will generally point to this commit instead of
a meaningful prior commit.  There are alternatives available that will attempt
to look through this change and find the appropriate prior commit.  YMMV.

llvm-svn: 280751
2016-09-06 20:57:50 +00:00

86 lines
2.7 KiB
C++

//===-- MICmnLogMediumFile.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#pragma once
// In-house headers:
#include "MICmnBase.h"
#include "MICmnLog.h"
#include "MIUtilDateTimeStd.h"
#include "MIUtilFileStd.h"
#include "MIUtilString.h"
//++
//============================================================================
// Details: MI common code implementation class. Logs application fn
// trace/message/
// error messages to a file. Used as part of the CMICmnLog Logger
// system. When instantiated *this object is register with the Logger
// which the Logger when given data to write to registered medium comes
// *this medium.
// Singleton class.
//--
class CMICmnLogMediumFile : public CMICmnBase, public CMICmnLog::IMedium {
// Statics:
public:
static CMICmnLogMediumFile &Instance();
// Methods:
public:
bool SetHeaderTxt(const CMIUtilString &vText);
bool SetVerbosity(const MIuint veType);
MIuint GetVerbosity() const;
const CMIUtilString &GetFileName() const;
const CMIUtilString &GetFileNamePath() const;
bool IsOk() const;
bool IsFileExist() const;
const CMIUtilString &GetLineReturn() const;
bool SetDirectory(const CMIUtilString &vPath);
// Overridden:
public:
// From CMICmnBase
/* dtor */ ~CMICmnLogMediumFile() override;
// From CMICmnLog::IMedium
bool Initialize() override;
const CMIUtilString &GetName() const override;
bool Write(const CMIUtilString &vData,
const CMICmnLog::ELogVerbosity veType) override;
const CMIUtilString &GetError() const override;
bool Shutdown() override;
// Methods:
private:
/* ctor */ CMICmnLogMediumFile();
/* ctor */ CMICmnLogMediumFile(const CMICmnLogMediumFile &);
void operator=(const CMICmnLogMediumFile &);
bool FileWriteEnglish(const CMIUtilString &vData);
bool FileFormFileNamePath();
CMIUtilString MassagedData(const CMIUtilString &vData,
const CMICmnLog::ELogVerbosity veType);
bool FileWriteHeader();
char ConvertLogVerbosityTypeToId(const CMICmnLog::ELogVerbosity veType) const;
CMIUtilString ConvertCr(const CMIUtilString &vData) const;
// Attributes:
private:
const CMIUtilString m_constThisMediumName;
const CMIUtilString m_constMediumFileNameFormat;
//
CMIUtilString m_strMediumFileName;
CMIUtilString m_strMediumFileDirectory;
CMIUtilString m_fileNamePath;
MIuint m_eVerbosityType;
CMIUtilString m_strDate;
CMIUtilString m_fileHeaderTxt;
CMIUtilFileStd m_file;
CMIUtilDateTimeStd m_dateTime;
};