/
glob.hpp
44 lines (37 loc) · 830 Bytes
/
glob.hpp
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
// src/glob/glob.hpp
//
//
#ifndef URPC_GLOB_HPP
#define URPC_GLOB_HPP
#include <fstream>
#include <google/protobuf/message.h>
namespace urpc {
class iglob {
public:
/** Open a glob file for reading
* \param filename file to open for reading
*/
iglob (const std::string &);
/** Read a protobuf from the file
* \param message destination of data
* \return TRUE if additional messages are available
*/
bool read (google::protobuf::Message &);
private:
std::fstream file;
};
class oglob {
public:
/** Open a file for writing
* \param filename file to write
*/
oglob (const std::string &);
/** Write a protobuf from the file
* \param message data to write
*/
void write (const google::protobuf::Message &);
private:
std::fstream file;
};
}
#endif // URPC_GLOB_HPP