| 150 | }; |
| 151 | |
| 152 | class Array final : public Value { |
| 153 | MGB_DYN_TYPE_OBJ_FINAL_DECL_WITH_EXPORT; |
| 154 | |
| 155 | std::vector<std::shared_ptr<Value>> m_val; |
| 156 | |
| 157 | public: |
| 158 | MGE_WIN_DECLSPEC_FUC static std::shared_ptr<Array> make() { |
| 159 | return std::make_shared<Array>(); |
| 160 | } |
| 161 | |
| 162 | MGE_WIN_DECLSPEC_FUC void add(std::shared_ptr<Value> val) { |
| 163 | mgb_assert(val); |
| 164 | m_val.emplace_back(std::move(val)); |
| 165 | } |
| 166 | |
| 167 | MGE_WIN_DECLSPEC_FUC std::shared_ptr<Value>& operator[](size_t idx) { |
| 168 | return m_val.at(idx); |
| 169 | } |
| 170 | |
| 171 | MGE_WIN_DECLSPEC_FUC void writeto(std::string& fout, int indent = 0) const override; |
| 172 | |
| 173 | auto&& get_impl() { return m_val; } |
| 174 | |
| 175 | auto&& get_impl() const { return m_val; } |
| 176 | }; |
| 177 | |
| 178 | class Null final : public Value { |
| 179 | MGB_DYN_TYPE_OBJ_FINAL_DECL_WITH_EXPORT; |
no test coverage detected