Asylo
Public Member Functions | List of all members
asylo::CheckOpMessageBuilder Class Reference

A helper class for formatting "expr (V1 vs. V2)" in a CHECK_XX statement. More...

#include <logging.h>

Public Member Functions

 CheckOpMessageBuilder (const char *exprtext)
 Constructs an object to format a CheckOp message. More...
 
 ~CheckOpMessageBuilder ()
 Deletes "stream_". More...
 
std::ostream * ForVar1 ()
 Gets the output stream for the first argument of the message. More...
 
std::ostream * ForVar2 ()
 Gets the output stream for writing the argument of the message. More...
 
std::string * NewString ()
 Gets the built string contents. More...
 

Detailed Description

A helper class for formatting "expr (V1 vs. V2)" in a CHECK_XX statement.

See MakeCheckOpString for sample usage.

Constructor & Destructor Documentation

◆ CheckOpMessageBuilder()

asylo::CheckOpMessageBuilder::CheckOpMessageBuilder ( const char *  exprtext)
explicit

Constructs an object to format a CheckOp message.

This constructor initializes the message first with exprtext followed by " (".

Parameters
exprtextA string representation of the code in file at line.

◆ ~CheckOpMessageBuilder()

asylo::CheckOpMessageBuilder::~CheckOpMessageBuilder ( )

Deletes "stream_".

Member Function Documentation

◆ ForVar1()

std::ostream* asylo::CheckOpMessageBuilder::ForVar1 ( )
inline

Gets the output stream for the first argument of the message.

Returns
The current stream message.

◆ ForVar2()

std::ostream* asylo::CheckOpMessageBuilder::ForVar2 ( )

Gets the output stream for writing the argument of the message.

This writes " vs. " to the stream first.

Returns
The current stream message.

◆ NewString()

std::string* asylo::CheckOpMessageBuilder::NewString ( )

Gets the built string contents.

The stream is finished with an added ")".

Returns
The current stream message.

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