@@ -169,6 +169,11 @@ module json_file_module
169
169
json_file_update_string_val_ascii
170
170
#endif
171
171
172
+ ! >
173
+ ! Remove a variable from a [[json_file(type)]]
174
+ ! by specifying the path.
175
+ generic,public :: remove = > MAYBEWRAP(json_file_remove)
176
+
172
177
! traverse
173
178
procedure ,public :: traverse = > json_file_traverse
174
179
@@ -244,6 +249,9 @@ module json_file_module
244
249
procedure :: json_file_update_string_val_ascii
245
250
#endif
246
251
252
+ ! remove:
253
+ procedure :: MAYBEWRAP(json_file_remove)
254
+
247
255
! print_file:
248
256
procedure :: json_file_print_to_console
249
257
procedure :: json_file_print_1
@@ -2192,6 +2200,42 @@ subroutine json_file_traverse(me,traverse_callback)
2192
2200
end subroutine json_file_traverse
2193
2201
! *****************************************************************************************
2194
2202
2203
+ ! *****************************************************************************************
2204
+ ! > author: Jacob Williams
2205
+ ! date: 7/7/2018
2206
+ !
2207
+ ! Remove a variable from a JSON file.
2208
+ !
2209
+ ! @note This is just a wrapper to [[remove_if_present]].
2210
+
2211
+ subroutine json_file_remove (me ,path )
2212
+
2213
+ implicit none
2214
+
2215
+ class(json_file),intent (inout ) :: me
2216
+ character (kind= CK,len=* ),intent (in ) :: path ! ! the path to the variable
2217
+
2218
+ call me% core% remove_if_present(me% p,path)
2219
+
2220
+ end subroutine json_file_remove
2221
+ ! *****************************************************************************************
2222
+
2223
+ ! *****************************************************************************************
2224
+ ! >
2225
+ ! Alternate version of [[json_file_remove]], where "path" is kind=CDK.
2226
+
2227
+ subroutine wrap_json_file_remove (me ,path )
2228
+
2229
+ implicit none
2230
+
2231
+ class(json_file),intent (inout ) :: me
2232
+ character (kind= CDK,len=* ),intent (in ) :: path ! ! the path to the variable
2233
+
2234
+ call me% remove(to_unicode(path))
2235
+
2236
+ end subroutine wrap_json_file_remove
2237
+ ! *****************************************************************************************
2238
+
2195
2239
! *****************************************************************************************
2196
2240
end module json_file_module
2197
2241
! *****************************************************************************************
0 commit comments