souffle  2.0.2-371-g6315b36
Public Member Functions | Private Attributes | Friends
souffle::DiagnosticMessage Class Reference

#include <ErrorReport.h>

Collaboration diagram for souffle::DiagnosticMessage:
Collaboration graph

Public Member Functions

 DiagnosticMessage (std::string message)
 
 DiagnosticMessage (std::string message, SrcLocation location)
 
const SrcLocationgetLocation () const
 
const std::string & getMessage () const
 
bool hasLocation () const
 
void print (std::ostream &out) const
 

Private Attributes

bool hasLoc
 
SrcLocation location
 
std::string message
 

Friends

std::ostream & operator<< (std::ostream &out, const DiagnosticMessage &diagnosticMessage)
 

Detailed Description

Definition at line 37 of file ErrorReport.h.

Constructor & Destructor Documentation

◆ DiagnosticMessage() [1/2]

souffle::DiagnosticMessage::DiagnosticMessage ( std::string  message,
SrcLocation  location 
)
inline

Definition at line 45 of file ErrorReport.h.

47  {

◆ DiagnosticMessage() [2/2]

souffle::DiagnosticMessage::DiagnosticMessage ( std::string  message)
inline

Definition at line 48 of file ErrorReport.h.

Member Function Documentation

◆ getLocation()

const SrcLocation& souffle::DiagnosticMessage::getLocation ( ) const
inline

Definition at line 54 of file ErrorReport.h.

◆ getMessage()

const std::string& souffle::DiagnosticMessage::getMessage ( ) const
inline

Definition at line 50 of file ErrorReport.h.

51  {
52  out << message;

References hasLoc, and message.

◆ hasLocation()

bool souffle::DiagnosticMessage::hasLocation ( ) const
inline

Definition at line 59 of file ErrorReport.h.

59  {
60  diagnosticMessage.print(out);
61  return out;

◆ print()

void souffle::DiagnosticMessage::print ( std::ostream &  out) const
inline

Definition at line 63 of file ErrorReport.h.

64  :
65  std::string message;
66  bool hasLoc;
67  SrcLocation location;
68 };
69 

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const DiagnosticMessage diagnosticMessage 
)
friend

Definition at line 71 of file ErrorReport.h.

71  :
72  enum class Type { ERROR, WARNING };
73 
74  Diagnostic(Type type, DiagnosticMessage primaryMessage, std::vector<DiagnosticMessage> additionalMessages)

Field Documentation

◆ hasLoc

bool souffle::DiagnosticMessage::hasLoc
private

Definition at line 78 of file ErrorReport.h.

Referenced by getMessage().

◆ location

SrcLocation souffle::DiagnosticMessage::location
private

Definition at line 79 of file ErrorReport.h.

◆ message

std::string souffle::DiagnosticMessage::message
private

Definition at line 77 of file ErrorReport.h.

Referenced by getMessage().


The documentation for this class was generated from the following file:
souffle::DiagnosticMessage::location
SrcLocation location
Definition: ErrorReport.h:79
souffle::DiagnosticMessage::hasLoc
bool hasLoc
Definition: ErrorReport.h:78
souffle::DiagnosticMessage::DiagnosticMessage
DiagnosticMessage(std::string message, SrcLocation location)
Definition: ErrorReport.h:45
souffle::DiagnosticMessage::message
std::string message
Definition: ErrorReport.h:77
std::type
ElementType type
Definition: span.h:640