ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
Warning Struct Reference

The Warning type. More...

#include <Warning.h>

Inheritance diagram for Warning:

Public Member Functions

Class * _Warning (void)
 The Warning archetype.
 
WarninginitWithFormat (Warning *self, WarningType type, const char *fmt,...)
 Initializes this Warning with the given type and format string.
 
WarninginitWithVaList (Warning *self, WarningType type, const char *fmt, va_list args)
 Initializes this Warning with the given type and format string.
 

Data Fields

String * message
 The message.
 
Object object
 The superclass.
 
WarningType type
 The WarningType.
 

Protected Attributes

WarningInterface * interface
 The interface.
 

Detailed Description

The Warning type.

Definition at line 50 of file Warning.h.

Member Function Documentation

◆ _Warning()

Class * _Warning ( void  )

The Warning archetype.

Returns
The Warning Class.

Definition at line 97 of file Warning.c.

97 {
98 static Class *clazz;
99 static Once once;
100
101 do_once(&once, {
102 clazz = _initialize(&(const ClassDef) {
103 .name = "Warning",
104 .superclass = _Object(),
105 .instanceSize = sizeof(Warning),
106 .interfaceOffset = offsetof(Warning, interface),
107 .interfaceSize = sizeof(WarningInterface),
109 });
110 });
111
112 return clazz;
113}
static void initialize(Class *clazz)
Definition Box.c:123
The Warning type.
Definition Warning.h:50
WarningInterface * interface
The interface.
Definition Warning.h:61

◆ initWithFormat()

Warning * initWithFormat ( Warning self,
WarningType  type,
const char *  fmt,
  ... 
)

Initializes this Warning with the given type and format string.

Parameters
selfThe Warning.
typeThe WarningType.
fmtThe format string.
Returns
The initialized Warning, or NULL on error.

Definition at line 50 of file Warning.c.

50 {
51
52 va_list args;
53 va_start(args, fmt);
54
55 self = $(self, initWithVaList, type, fmt, args);
56
57 va_end(args);
58
59 return self;
60}
Warning * initWithVaList(Warning *self, WarningType type, const char *fmt, va_list args)
Initializes this Warning with the given type and format string.
Definition Warning.c:66
WarningType type
The WarningType.
Definition Warning.h:66

◆ initWithVaList()

Warning * initWithVaList ( Warning self,
WarningType  type,
const char *  fmt,
va_list  args 
)

Initializes this Warning with the given type and format string.

Parameters
selfThe Warning.
typeThe WarningType.
fmtThe format string.
argsThe format arguments .
Returns
The initialized Warning, or NULL on error.

Definition at line 66 of file Warning.c.

66 {
67
68 self = (Warning *) super(Object, self, init);
69 if (self) {
70 self->type = type;
71 assert(self->type);
72
73 self->message = $(alloc(String), initWithVaList, fmt, args);
74 assert(self->message);
75 }
76
77 return self;
78}
static View * init(View *self)
Definition Box.c:67
String * message
The message.
Definition Warning.h:71

Field Documentation

◆ interface

WarningInterface* Warning::interface
protected

The interface.

Definition at line 61 of file Warning.h.

◆ message

String* Warning::message

The message.

Definition at line 71 of file Warning.h.

◆ object

Object Warning::object

The superclass.

Definition at line 55 of file Warning.h.

◆ type

WarningType Warning::type

The WarningType.

Definition at line 66 of file Warning.h.


The documentation for this struct was generated from the following files: