74 lines
1.6 KiB
C++
74 lines
1.6 KiB
C++
#ifndef RJP_OBJECT_HPP
|
|
#define RJP_OBJECT_HPP
|
|
|
|
#include "value.hpp"
|
|
#include "integral.hpp"
|
|
#include "string.hpp"
|
|
#include "string_val.hpp"
|
|
#include "iterator.hpp"
|
|
#include <rjp.h>
|
|
#include <rexy/string.hpp>
|
|
|
|
namespace rjp{
|
|
|
|
class object_iterator : protected detail::iterator_base
|
|
{
|
|
protected:
|
|
RJP_object_iterator m_it;
|
|
|
|
public:
|
|
object_iterator(void);
|
|
object_iterator(RJP_value* v);
|
|
object_iterator(const object_iterator&) = delete;
|
|
object_iterator(object_iterator&& o);
|
|
~object_iterator(void);
|
|
object_iterator& operator=(const object_iterator&) = delete;
|
|
object_iterator& operator=(object_iterator&& o);
|
|
|
|
bool operator==(const object_iterator& o)const;
|
|
bool operator!=(const object_iterator& o)const;
|
|
member operator*(void)const;
|
|
value_wrapper operator->(void)const;
|
|
|
|
object_iterator& operator++(void);
|
|
};
|
|
|
|
class object : public value
|
|
{
|
|
public:
|
|
using iterator = object_iterator;
|
|
using const_iterator = const iterator;
|
|
public:
|
|
using value::value;
|
|
object(void);
|
|
object(const value& val);
|
|
object(value&& val);
|
|
|
|
object(const object&) = default;
|
|
object(object&&) = default;
|
|
~object(void) = default;
|
|
object& operator=(const object&) = default;
|
|
object& operator=(object&&) = default;
|
|
|
|
member add(const rexy::string_base& key);
|
|
|
|
value remove(const rexy::string_base& key);
|
|
value& remove(value& val);
|
|
|
|
void destroy(const rexy::string_base& key);
|
|
void destroy(value&& val);
|
|
|
|
bool has_child(const value&);
|
|
|
|
iterator begin(void);
|
|
const_iterator begin(void)const;
|
|
iterator end(void)const;
|
|
|
|
value search(const rexy::string_base& key);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|