LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::Report Class Referencefinal

Error and warning report class. More...

#include <Report.h>

Public Member Functions

 Report ()
 Constructs an empty report.
 Report (const char *text, bool hasErrors)
 Constructs the report with the specified text and flag.
 Report (const StringView &text, bool hasErrors)
 Constructs the report with the specified text and flag.
 Report (std::string &&text, bool hasErrors)
 Constructs the report by taking the ownership of the specified string.
 Report (const Report &rhs)
 Copy constructor.
 Report (Report &&rhs) noexcept
 Move constructor.
 ~Report ()
 Deletes the internal report.
const char * GetText () const
 Returns a NUL-terminated string of the report text. This must never be null.
bool HasErrors () const
 Returns true if this report contains error messages.
void Reset (const char *text, bool hasErrors)
 Overrides the report with a copy of the specified text and flag.
void Reset (const StringView &text, bool hasErrors)
 Overrides the report with a copy of the specified text and flag.
void Reset (std::string &&text, bool hasErrors)
 Overrides the report by taking the ownership of the specified string.
void Printf (const char *format,...)
 Appends a formatted message to this report. The previous error flag remains unchanged.
void Errorf (const char *format,...)
 Appends a formatted message to this report and sets the error flag to true.
Report & operator= (const Report &rhs)
 Copy operator.
Report & operator= (Report &&rhs) noexcept
 Move operator.
 operator bool () const
 Returns true if this report has a non-empty text or is marked as having errors.

Detailed Description

Error and warning report class.

Remarks
To report errors globally, use the Log interface.
See also
PipelineState::GetReport
RenderSystem::GetReport
Shader::GetReport
Log::Printf
Log::Errorf

Constructor & Destructor Documentation

◆ Report() [1/6]

LLGL::Report::Report ( )

Constructs an empty report.

◆ Report() [2/6]

LLGL::Report::Report ( const char * text,
bool hasErrors )

Constructs the report with the specified text and flag.

◆ Report() [3/6]

LLGL::Report::Report ( const StringView & text,
bool hasErrors )

Constructs the report with the specified text and flag.

◆ Report() [4/6]

LLGL::Report::Report ( std::string && text,
bool hasErrors )

Constructs the report by taking the ownership of the specified string.

◆ Report() [5/6]

LLGL::Report::Report ( const Report & rhs)

Copy constructor.

◆ Report() [6/6]

LLGL::Report::Report ( Report && rhs)
noexcept

Move constructor.

◆ ~Report()

LLGL::Report::~Report ( )

Deletes the internal report.

Member Function Documentation

◆ Errorf()

void LLGL::Report::Errorf ( const char * format,
... )

Appends a formatted message to this report and sets the error flag to true.

Parameters
[in]formatSpecifies the formatted message. Same as ::printf.

◆ GetText()

const char * LLGL::Report::GetText ( ) const

Returns a NUL-terminated string of the report text. This must never be null.

Remarks
LLGL backends always append the newline character '\n' at the end of formatted string. This is not required, but makes reports with either a single or multiple lines consistent. Therefore, printing such a report to the standard output does not require an additional newline character:
// C++ standard output:
std::cout << myReport.GetText();
// C standard output:
printf("%s", myReport.GetText());
// LLGL Log output:
LLGL::Log::Printf("%s", myReport.GetText());
LLGL_EXPORT void Printf(const char *format,...)
Prints a formatted message to the log.

◆ HasErrors()

bool LLGL::Report::HasErrors ( ) const

Returns true if this report contains error messages.

◆ operator bool()

LLGL::Report::operator bool ( ) const

Returns true if this report has a non-empty text or is marked as having errors.

◆ operator=() [1/2]

Report & LLGL::Report::operator= ( const Report & rhs)

Copy operator.

◆ operator=() [2/2]

Report & LLGL::Report::operator= ( Report && rhs)
noexcept

Move operator.

◆ Printf()

void LLGL::Report::Printf ( const char * format,
... )

Appends a formatted message to this report. The previous error flag remains unchanged.

Parameters
[in]formatSpecifies the formatted message. Same as ::printf.

◆ Reset() [1/3]

void LLGL::Report::Reset ( const char * text,
bool hasErrors )

Overrides the report with a copy of the specified text and flag.

◆ Reset() [2/3]

void LLGL::Report::Reset ( const StringView & text,
bool hasErrors )

Overrides the report with a copy of the specified text and flag.

◆ Reset() [3/3]

void LLGL::Report::Reset ( std::string && text,
bool hasErrors )

Overrides the report by taking the ownership of the specified string.


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