memgraph/data_model/json/bool.hpp

34 lines
491 B
C++
Raw Normal View History

2015-06-22 04:20:36 +08:00
#ifndef MEMGRAPH_DATA_MODEL_JSON_BOOL_HPP
#define MEMGRAPH_DATA_MODEL_JSON_BOOL_HPP
2015-06-22 03:15:46 +08:00
#include "primitive.hpp"
namespace json {
class Bool final : public Primitive<bool>
{
public:
Bool() {}
Bool(bool value)
: Primitive<bool>(value) {}
virtual bool is_boolean() const;
virtual operator std::string() const;
};
bool Bool::is_boolean() const
{
return true;
}
Bool::operator std::string() const
{
return value == true ? "true" : "false";
}
}
#endif