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