File: err.C

package info (click to toggle)
librudiments0 0.27-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,528 kB
  • ctags: 2,284
  • sloc: cpp: 14,657; sh: 7,547; ansic: 2,664; makefile: 945; xml: 15
file content (45 lines) | stat: -rw-r--r-- 737 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright (c) 2002  David Muse
// See the file COPYING for more information

#include <rudiments/errorhandler.h>
#include <stdio.h>

class myclass : public errorhandler {
	public:
		void	test1();
		void	test2();
		void	test3();
		void	test4();
};

void	myclass::test1() {
	clearError();
	appendError("error1");
}

void	myclass::test2() {
	clearError();
	appendError("error2");
}

void	myclass::test3() {
	clearError();
	appendError("error3");
}

void	myclass::test4() {
	clearError();
	appendError("error4");
}

int main(int argc, const char **argv) {
	myclass	m;
	m.test1();
	printf("%s\n",m.getError());
	m.test2();
	printf("%s\n",m.getError());
	m.test3();
	printf("%s\n",m.getError());
	m.test4();
	printf("%s\n",m.getError());
}