GCC Middle and Back End API Reference
diagnostic_output_file Class Reference

#include <diagnostic-output-file.h>

Public Member Functions

 diagnostic_output_file ()
 
 diagnostic_output_file (FILE *outf, bool owned, label_text filename)
 
 ~diagnostic_output_file ()
 
 diagnostic_output_file (const diagnostic_output_file &other)=delete
 
 diagnostic_output_file (diagnostic_output_file &&other)
 
diagnostic_output_fileoperator= (const diagnostic_output_file &other)=delete
 
diagnostic_output_fileoperator= (diagnostic_output_file &&other)
 
 operator bool () const
 
FILE * get_open_file () const
 
const char * get_filename () const
 

Private Attributes

FILE * m_outf
 
bool m_owned
 
label_text m_filename
 

Detailed Description

RAII class for managing FILE * for diagnostic formats.
   Copyright (C) 2024 Free Software Foundation, Inc.
   Contributed by David Malcolm <dmalcolm@redhat.com>.

This file is part of GCC.

GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
version.

GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3.  If not see
<http://www.gnu.org/licenses/>.   
RAII class for wrapping a FILE * that could be borrowed or owned,
along with the underlying filename.   

Constructor & Destructor Documentation

◆ diagnostic_output_file() [1/4]

diagnostic_output_file::diagnostic_output_file ( )
inline

◆ diagnostic_output_file() [2/4]

diagnostic_output_file::diagnostic_output_file ( FILE * outf,
bool owned,
label_text filename )
inline

References gcc_assert, m_filename, m_outf, and m_owned.

◆ ~diagnostic_output_file()

diagnostic_output_file::~diagnostic_output_file ( )
inline

References gcc_assert, m_outf, and m_owned.

◆ diagnostic_output_file() [3/4]

diagnostic_output_file::diagnostic_output_file ( const diagnostic_output_file & other)
delete

◆ diagnostic_output_file() [4/4]

diagnostic_output_file::diagnostic_output_file ( diagnostic_output_file && other)
inline

References gcc_assert, m_filename, m_outf, and m_owned.

Member Function Documentation

◆ get_filename()

const char * diagnostic_output_file::get_filename ( ) const
inline

◆ get_open_file()

FILE * diagnostic_output_file::get_open_file ( ) const
inline

◆ operator bool()

diagnostic_output_file::operator bool ( ) const
inline

References m_outf.

◆ operator=() [1/2]

diagnostic_output_file & diagnostic_output_file::operator= ( const diagnostic_output_file & other)
delete

◆ operator=() [2/2]

diagnostic_output_file & diagnostic_output_file::operator= ( diagnostic_output_file && other)
inline

References gcc_assert, m_filename, m_outf, and m_owned.

Field Documentation

◆ m_filename

label_text diagnostic_output_file::m_filename
private

◆ m_outf

FILE* diagnostic_output_file::m_outf
private

◆ m_owned

bool diagnostic_output_file::m_owned
private

The documentation for this class was generated from the following file: