File tree Expand file tree Collapse file tree 2 files changed +56
-4
lines changed
Expand file tree Collapse file tree 2 files changed +56
-4
lines changed Original file line number Diff line number Diff line change 22 * @file json.hh
33 * @author Simone Ancona
44 * @brief A JSON parser for C++
5- * @version 1.0
6- * @date 2023-07-14
5+ * @version 1.1
6+ * @date 2023-07-15
77 *
88 * @copyright Copyright (c) 2023
99 *
@@ -193,6 +193,38 @@ namespace Jpp
193193 * @return std::string
194194 */
195195 std::string to_string ();
196+
197+ /* *
198+ * @brief Begin iterator
199+ *
200+ * @return std::map<std::string, Json>::iterator
201+ * @since v1.1
202+ */
203+ std::map<std::string, Json>::iterator begin ();
204+
205+ /* *
206+ * @brief End iterator
207+ *
208+ * @return std::map<std::string, Json>::iterator
209+ * @since v1.1
210+ */
211+ std::map<std::string, Json>::iterator end ();
212+
213+ /* *
214+ * @brief Reverse begin iterator
215+ *
216+ * @return std::map<std::string, Json>::iterator
217+ * @since v1.1
218+ */
219+ std::map<std::string, Json>::reverse_iterator rbegin ();
220+
221+ /* *
222+ * @brief Reverse end iterator
223+ *
224+ * @return std::map<std::string, Json>::iterator
225+ * @since v1.1
226+ */
227+ std::map<std::string, Json>::reverse_iterator rend ();
196228 };
197229
198230 void trim_string (std::string &);
Original file line number Diff line number Diff line change 22 * @file json.cc
33 * @author Simone Ancona
44 * @brief
5- * @version 1.0
6- * @date 2023-07-14
5+ * @version 1.1
6+ * @date 2023-07-15
77 *
88 * @copyright Copyright (c) 2023
99 *
@@ -152,6 +152,26 @@ Jpp::Json &Jpp::Json::operator=(int num)
152152 return *this ;
153153}
154154
155+ std::map<std::string, Jpp::Json>::iterator Jpp::Json::begin ()
156+ {
157+ return children.begin ();
158+ }
159+
160+ std::map<std::string, Jpp::Json>::iterator Jpp::Json::end ()
161+ {
162+ return children.end ();
163+ }
164+
165+ std::map<std::string, Jpp::Json>::reverse_iterator Jpp::Json::rbegin ()
166+ {
167+ return children.rbegin ();
168+ }
169+
170+ std::map<std::string, Jpp::Json>::reverse_iterator Jpp::Json::rend ()
171+ {
172+ return children.rend ();
173+ }
174+
155175void Jpp::Json::parse (std::string json_string)
156176{
157177 trim_string (json_string);
You can’t perform that action at this time.
0 commit comments