aboutsummaryrefslogtreecommitdiffstats
path: root/tool/PGListUtil/src/common/CErrorList.h
blob: 5583bb8dea33d7952adc8ac8e30a3cecc5f7319e (plain)
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
#ifndef CERRLIST_H
#define CERRLIST_H

#include <boost/pool/pool.hpp>
#include "common.h"

namespace pglu {
namespace error {

typedef enum _EErrKind {
	SYNTAX,
	IP,
	SYNTAX_RESTORABLE
} EErrKind;

typedef struct _CError {
	int			line;
	EErrKind	kind;
	_CError *	next;
} CError;

class CErrorList {
private:
	boost::pool<>	m_pool;
	CError			m_errHead;
	CError *		m_errFoot;
	CError *		m_errNext;
	int				m_count;

public:
	CErrorList();
	~CErrorList();

	void Clear();
	bool LoadListFile(const char *path);
	int Count();
	CError * GetNext();
};

} // namespace error
} // namespace pglu

#endif // CERRLIST_H