OpenPose 1.0.0rc2 OpenPose: A Real-Time Multi-Person Key-Point Detection And Multi-Threading C++ Library

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
jsonOfstream.hpp
Go to the documentation of this file.
1 #ifndef OPENPOSE_FILESTREAM_JSON_OFSTREAM_HPP
2 #define OPENPOSE_FILESTREAM_JSON_OFSTREAM_HPP
3
4 #include <fstream> // std::ofstream
5 #include <openpose/core/common.hpp>
6
7 namespace op
8 {
9 class OP_API JsonOfstream
10 {
11 public:
12 explicit JsonOfstream(const std::string& filePath, const bool humanReadable = true);
13
14 virtual ~JsonOfstream();
15
16 void objectOpen();
17
18 void objectClose();
19
20 void arrayOpen();
21
22 void arrayClose();
23
24 void version(const std::string& version);
25
26 void key(const std::string& string);
27
28 template <typename T>
29 inline void plainText(const T& value)
30 {
31 mOfstream << value;
32 }
33
34 inline void comma()
35 {
36 mOfstream << ",";
37 }
38
39 void enter();
40
41 private:
42 const bool mHumanReadable;
43 long long mBracesCounter;
44 long long mBracketsCounter;
45 std::ofstream mOfstream;
46
47 DELETE_COPY(JsonOfstream);
48 };
49 }
50
51 #endif // OPENPOSE_FILESTREAM_JSON_OFSTREAM_HPP
DELETE_COPY
#define DELETE_COPY(className)
Definition: macros.hpp:34
common.hpp
op::JsonOfstream
Definition: jsonOfstream.hpp:9
op::JsonOfstream::plainText
void plainText(const T &value)
Definition: jsonOfstream.hpp:29
op::JsonOfstream::comma
void comma()
Definition: jsonOfstream.hpp:34
OP_API
#define OP_API
Definition: macros.hpp:19
cl::string
std::string string
Definition: cl2.hpp:574