memgraph/data_model/json/bool.hpp
Dominik Tomičević b4a6ca3487 added a JSON class
2015-06-21 21:15:46 +02:00

34 lines
451 B
C++

#ifndef JSON_BOOL_HPP
#define JSON_BOOL_HPP
#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