Util

class CtlReportLogWriter : public ILogWriter
#include <ctlReportLogWriter.h>

Used to output log messages in special dialog window. A color of text messages depends on their types. At the end of window summary info is represented with number of errors and warnings.

Public Functions

inline CtlReportLogWriter()

Constructor.

virtual void addMessageFmt(MessageType type, const char *fmt, const DagorSafeArg *arg, int anum)

Add formatted message.

inline virtual bool hasErrors() const

Test whether messages list has error messages.

Returns:

true if messages list has error messages, false in other case

inline virtual void startLog()

starts log messages counting

inline virtual void endLog()

finishes log messages counting

void clearMessages()

Clear messages list. (for reusing one log writer object for several operations)

inline bool hasWarnings() const

Test whether messages list has warning messages.

Returns:

true if messages list has warning messages, false in other case

inline bool hasMessages() const

Test whether messages list has messages.

Returns:

true if messages list is not empty, false in other case

bool showReport(const char *title, const char *error_msg, const char *ok_msg)

Show dialog window with messages list.

Parameters:
  • title[in] - window title

  • error_msg[in] - message displayed at the end of window if there are error messages in messages list

  • ok_msg[in] - message displayed at the end of window if there are no error messages in messages list

Returns:

true if user pressed ‘OK’ button, false if user pressed ‘Cancel’ button

Protected Attributes

Tab<SimpleString> list
bool errors
bool warnings
struct DagUUID
#include <dagUuid.h>

128-bit Universally unique ID.

Public Functions

inline void clear()

Clear UUID (set all bitts to 0).

inline bool equal(const DagUUID &id)

Test for equality with specified UUID.

Parameters:

id[in] - reference to UUID to test

Returns:

true if UUID equals specified UUID, false in other case

Public Members

unsigned uuid[4]

Array for storing UUID data.

Public Static Functions

static void generate(DagUUID &out)

Generate UUID. The function uses Windows SDK’s UuidCreate().

Parameters:

out[out] - created UUID

Defines

DSA_OVERLOADS_PARAM_DECL

void addMessage(MessageType type, const char *fmt, typesafe-var-args…)

DSA_OVERLOADS_PARAM_PASS
class ILogWriter
#include <iLogWriter.h>

Interface class for message logging management.

Subclassed by ConsoleLogWriter, CtlReportLogWriter, ReportLogWriter

Public Types

enum MessageType

Messages types.

Values:

enumerator NOTE

Note message.

enumerator WARNING

Warning message.

enumerator ERROR

Error message.

enumerator FATAL

Fatal error message.

enumerator REMARK

Remark (low priority) message.

Public Functions

virtual void addMessageFmt(MessageType type, const char *fmt, const DagorSafeArg *arg, int anum) = 0

Add formatted message to log.

Parameters:
  • fmt[in] - printf-like format string (dagor format extension)

  • type[in] - message type (see enum MessageType)

  • arg, anum[in] - type-safe parameters to be used by format

virtual bool hasErrors() const = 0

returns true when log contains ERROR/FATAL messages

virtual void startLog() = 0

starts log messages counting

virtual void endLog() = 0

finishes log messages counting

DECLARE_DSA_OVERLOADS_FAMILY_LT(void addMessage, addMessageFmt)
class ReportLogWriter : public ILogWriter
#include <reportLogWriter.h>

Used to output log messages in special dialog window. A color of text messages depends on their types. At the end of window summary info is represented with number of errors and warnings.

Public Functions

inline ReportLogWriter()

Constructor.

virtual void addMessageFmt(MessageType type, const char *fmt, const DagorSafeArg *arg, int anum) override

Add formatted message.

inline virtual bool hasErrors() const override

Test whether messages list has error messages.

Returns:

true if messages list has error messages, false in other case

inline virtual void startLog() override

starts log messages counting

inline virtual void endLog() override

finishes log messages counting

void clearMessages()

Clear messages list. (for reusing one log writer object for several operations)

inline bool hasWarnings() const

Test whether messages list has warning messages.

Returns:

true if messages list has warning messages, false in other case

inline bool hasMessages() const

Test whether messages list has messages.

Returns:

true if messages list is not empty, false in other case

bool showReport(const char *title, const char *error_msg, const char *ok_msg)

Show dialog window with messages list.

Parameters:
  • title[in] - window title

  • error_msg[in] - message displayed at the end of window if there are error messages in messages list

  • ok_msg[in] - message displayed at the end of window if there are no error messages in messages list

Returns:

true if user pressed ‘OK’ button, false if user pressed ‘Cancel’ button

Protected Attributes

Tab<SimpleString> list
bool errors
bool warnings