|
|
|
@ -21,28 +21,28 @@ public:
|
|
|
|
|
Array() {} |
|
|
|
|
virtual ~Array() {} |
|
|
|
|
|
|
|
|
|
Array(const std::vector<Value>& values) |
|
|
|
|
: m_values(values) |
|
|
|
|
Array(const std::vector<Value>& elements) |
|
|
|
|
: m_elements(elements) |
|
|
|
|
{} |
|
|
|
|
|
|
|
|
|
Array(const Array& other) |
|
|
|
|
: m_values(other.m_values) |
|
|
|
|
: m_elements(other.m_elements) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void emplace_back(Value value); |
|
|
|
|
void reserve(size_t size) { m_values.reserve(size); } |
|
|
|
|
void emplace_back(Value element); |
|
|
|
|
void reserve(size_t size) { m_elements.reserve(size); } |
|
|
|
|
|
|
|
|
|
Value& operator[](size_t index); |
|
|
|
|
|
|
|
|
|
Value& at(size_t index) { return m_values.at(index); } |
|
|
|
|
const Value& at(size_t index) const { return m_values.at(index); } |
|
|
|
|
Value& at(size_t index) { return m_elements.at(index); } |
|
|
|
|
const Value& at(size_t index) const { return m_elements.at(index); } |
|
|
|
|
|
|
|
|
|
size_t size() const { return m_values.size(); } |
|
|
|
|
const std::vector<Value>& values() const { return m_values; } |
|
|
|
|
size_t size() const { return m_elements.size(); } |
|
|
|
|
const std::vector<Value>& elements() const { return m_elements; } |
|
|
|
|
|
|
|
|
|
private: |
|
|
|
|
std::vector<Value> m_values; |
|
|
|
|
std::vector<Value> m_elements; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
} // namespace Json
|
|
|
|
|