Menu

[r311]: / framework / branches / cache / http_error.h  Maximize  Restore  History

Download this file

29 lines (23 with data), 624 Bytes

 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
#ifndef _HTTP_ERROR_H
#define _HTTP_ERROR_H
#include <string>
using namespace std;
#define HTTP_ERROR_MAX_ERROR_MESSAGE_LEN 256
class HTTP_Error {
bool State404;
char message[HTTP_ERROR_MAX_ERROR_MESSAGE_LEN];
public:
char const *get() { return message; };
bool is_404() { return State404; };
HTTP_Error(char const *text,bool NotFound = false)
{
strncpy(message,text,HTTP_ERROR_MAX_ERROR_MESSAGE_LEN);
State404 = NotFound;
};
HTTP_Error(string const &str,bool NotFound = false)
{
strncpy(message,str.c_str(),HTTP_ERROR_MAX_ERROR_MESSAGE_LEN);
State404 = NotFound;
};
};
#endif /* _HTTP_ERROR_H */
MongoDB Logo MongoDB