|
a/src/utils/readfile.h |
|
b/src/utils/readfile.h |
|
... |
|
... |
17 |
#ifndef _READFILE_H_INCLUDED_
|
17 |
#ifndef _READFILE_H_INCLUDED_
|
18 |
#define _READFILE_H_INCLUDED_
|
18 |
#define _READFILE_H_INCLUDED_
|
19 |
/* @(#$Id: readfile.h,v 1.3 2007-06-02 08:30:42 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: readfile.h,v 1.3 2007-06-02 08:30:42 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
|
|
22 |
using std::string;
|
22 |
|
23 |
|
23 |
/**
|
24 |
/**
|
24 |
* Read whole file into string.
|
25 |
* Read whole file into string.
|
25 |
* @return true for ok, false else
|
26 |
* @return true for ok, false else
|
26 |
*/
|
27 |
*/
|
27 |
bool file_to_string(const std::string &filename, std::string &data,
|
28 |
bool file_to_string(const string &filename, string &data, string *reason = 0);
|
|
|
29 |
|
|
|
30 |
class FileScanDo {
|
|
|
31 |
public:
|
|
|
32 |
virtual ~FileScanDo() {}
|
|
|
33 |
virtual bool init(unsigned int size, string *reason) = 0;
|
|
|
34 |
virtual bool data(const char *buf, int cnt, string* reason) = 0;
|
|
|
35 |
};
|
|
|
36 |
bool file_scan(const std::string &filename, FileScanDo* doer,
|
28 |
std::string *reason = 0);
|
37 |
std::string *reason = 0);
|
29 |
|
38 |
|
30 |
#endif /* _READFILE_H_INCLUDED_ */
|
39 |
#endif /* _READFILE_H_INCLUDED_ */
|