You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or, get the latest development code from the master branch
@@ -130,8 +135,11 @@ endforeach()
130
135
131
136
[top](#json-fortran)
132
137
133
-
Reading JSON from a file
138
+
Exapmle Usage
134
139
---------------
140
+
In this section the basic functionality of the JSON-Fortran library is illustrated.
141
+
142
+
### Reading JSON from a file
135
143
136
144
Reading a JSON file and getting data from it is fairly
137
145
straightforward using the `json_file` class. Here is an example. See unit tests 1 and 3-6
@@ -173,8 +181,7 @@ for more examples. The source files may be found in `src/tests/`.
173
181
174
182
[top](#json-fortran)
175
183
176
-
Reading JSON from a string
177
-
---------------
184
+
### Reading JSON from a string
178
185
179
186
JSON can also be read directly from a character string like so:
180
187
```fortran
@@ -183,8 +190,7 @@ JSON can also be read directly from a character string like so:
183
190
184
191
[top](#json-fortran)
185
192
186
-
Modifying variables in a JSON file
187
-
---------------
193
+
### Modifying variables in a JSON file
188
194
189
195
After reading a JSON file, if you want to change the values of some of the variables, you can use the `update` method. For the example above:
190
196
@@ -197,8 +203,7 @@ After reading a JSON file, if you want to change the values of some of the varia
197
203
198
204
[top](#json-fortran)
199
205
200
-
Writing a JSON file
201
-
---------------
206
+
### Writing a JSON file
202
207
203
208
To print the JSON file (either to a file or the console), the `print_file` method can be used. For the above example:
204
209
@@ -209,8 +214,7 @@ To print the JSON file (either to a file or the console), the `print_file` metho
209
214
210
215
[top](#json-fortran)
211
216
212
-
Building a JSON file from scratch
213
-
---------------
217
+
### Building a JSON file from scratch
214
218
215
219
Constructing a JSON file element by element is slightly more complicated and involves the use
216
220
of `json_value` pointers. For more examples see unit tests 2, 4 and 7 in `src/tests/`.
@@ -297,8 +301,11 @@ shell script and CMake will also generate these files automatically in the docum
297
301
298
302
[top](#json-fortran)
299
303
300
-
Contributing[](https://github.com/jacobwilliams/json-fortran/blob/master/CONTRIBUTING.md)
304
+
Contributing
301
305
------------
306
+
307
+
[](https://github.com/jacobwilliams/json-fortran/blob/master/CONTRIBUTING.md)
308
+
302
309
Want to help? Take a quick look at our [contributing guidelines](https://github.com/jacobwilliams/json-fortran/blob/master/CONTRIBUTING.md) then claim something in [the "ready" column on our Waffle.io](https://waffle.io/jacobwilliams/json-fortran) and [Fork. Commit. Pull request.](https://help.github.com/articles/fork-a-repo)
0 commit comments