All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
jsonOfstream.hpp
Go to the documentation of this file.
#ifndef OPENPOSE_FILESTREAM_JSON_OFSTREAM_HPP
#define OPENPOSE_FILESTREAM_JSON_OFSTREAM_HPP
#include <fstream> // std::ofstream
#include <openpose/core/common.hpp>
namespace op
{
class OP_API JsonOfstream
{
public:
explicit JsonOfstream(const std::string& filePath, const bool humanReadable = true);
virtual ~JsonOfstream();
void objectOpen();
void objectClose();
void arrayOpen();
void arrayClose();
void version(const std::string& version);
void key(const std::string& string);
template <typename T>
inline void plainText(const T& value)
{
mOfstream << value;
}
inline void comma()
{
mOfstream << ",";
}
void enter();
private:
const bool mHumanReadable;
long long mBracesCounter;
long long mBracketsCounter;
std::ofstream mOfstream;
DELETE_COPY(JsonOfstream);
};
}
#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