Skip to content

Commit c78da93

Browse files
committed
all the rename methods now overloaded as just "rename"
1 parent 849c8e3 commit c78da93

File tree

3 files changed

+18
-21
lines changed

3 files changed

+18
-21
lines changed

src/json_file_module.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ subroutine json_file_rename(me,path,name,found)
880880
character(kind=CK,len=*),intent(in) :: name !! the new name
881881
logical(LK),intent(out),optional :: found !! if the variable was found
882882

883-
call me%core%rename_by_path(me%p, path, name, found)
883+
call me%core%rename(me%p, path, name, found)
884884

885885
end subroutine json_file_rename
886886
!*****************************************************************************************

src/json_value_module.F90

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -386,17 +386,6 @@ module json_value_module
386386
procedure :: json_add_string_vec_by_path_path_ascii
387387
#endif
388388

389-
!>
390-
! Rename a variable, by specifying its path.
391-
generic,public :: rename_by_path => MAYBEWRAP(json_rename_by_path)
392-
procedure :: MAYBEWRAP(json_rename_by_path)
393-
#ifdef USE_UCS4
394-
generic,public :: rename_by_path => json_rename_by_path_name_ascii,&
395-
json_rename_by_path_path_ascii
396-
procedure :: json_rename_by_path_name_ascii
397-
procedure :: json_rename_by_path_path_ascii
398-
#endif
399-
400389
!>
401390
! Create a [[json_value]] linked list using the
402391
! path to the variables. Optionally return a
@@ -636,8 +625,16 @@ module json_value_module
636625

637626
!>
638627
! Rename a [[json_value]] variable.
639-
generic,public :: rename => MAYBEWRAP(json_value_rename)
628+
generic,public :: rename => MAYBEWRAP(json_value_rename),&
629+
MAYBEWRAP(json_rename_by_path)
640630
procedure :: MAYBEWRAP(json_value_rename)
631+
procedure :: MAYBEWRAP(json_rename_by_path)
632+
#ifdef USE_UCS4
633+
generic,public :: rename => json_rename_by_path_name_ascii,&
634+
json_rename_by_path_path_ascii
635+
procedure :: json_rename_by_path_name_ascii
636+
procedure :: json_rename_by_path_path_ascii
637+
#endif
641638

642639
!>
643640
! get info about a [[json_value]]
@@ -5747,7 +5744,7 @@ subroutine wrap_json_rename_by_path(json, me, path, name, found)
57475744
character(kind=CDK,len=*),intent(in) :: name
57485745
logical(LK),intent(out),optional :: found
57495746

5750-
call json%rename_by_path(me,to_unicode(path),to_unicode(name),found)
5747+
call json%rename(me,to_unicode(path),to_unicode(name),found)
57515748

57525749
end subroutine wrap_json_rename_by_path
57535750
!*****************************************************************************************
@@ -5766,7 +5763,7 @@ subroutine json_rename_by_path_name_ascii(json, me, path, name, found)
57665763
character(kind=CDK,len=*),intent(in) :: name
57675764
logical(LK),intent(out),optional :: found
57685765

5769-
call json%rename_by_path(me,path,to_unicode(name),found)
5766+
call json%rename(me,path,to_unicode(name),found)
57705767

57715768
end subroutine json_rename_by_path_name_ascii
57725769
!*****************************************************************************************
@@ -5785,7 +5782,7 @@ subroutine json_rename_by_path_path_ascii(json, me, path, name, found)
57855782
character(kind=CK,len=*),intent(in) :: name
57865783
logical(LK),intent(out),optional :: found
57875784

5788-
call json%rename_by_path(me,to_unicode(path),name,found)
5785+
call json%rename(me,to_unicode(path),name,found)
57895786

57905787
end subroutine json_rename_by_path_path_ascii
57915788
!*****************************************************************************************

src/tests/jf_test_17.F90

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ subroutine test_17(error_cnt)
7373
! rename by specifying the path:
7474
write(error_unit,'(A)') ''
7575
write(error_unit,'(A)') 'Rename: "iflag" to "flag"'
76-
call json%rename_by_path(p,'iflag','flag')
76+
call json%rename(p,'iflag','flag')
7777
call json%print(p,output_unit)
7878
if (json%failed()) then
7979
call json%print_error_message(error_unit)
@@ -89,10 +89,10 @@ subroutine test_17(error_cnt)
8989
nullify(q)
9090

9191
! unicode wrappers:
92-
call json%rename_by_path(p,CK_'flag', CK_'iflag')
93-
call json%rename_by_path(p,CK_'iflag', CDK_'flag')
94-
call json%rename_by_path(p,CDK_'flag', CK_'iflag')
95-
call json%rename_by_path(p,CDK_'iflag',CDK_'flag')
92+
call json%rename(p,CK_'flag', CK_'iflag')
93+
call json%rename(p,CK_'iflag', CDK_'flag')
94+
call json%rename(p,CDK_'flag', CK_'iflag')
95+
call json%rename(p,CDK_'iflag',CDK_'flag')
9696
if (json%failed()) then
9797
call json%print_error_message(error_unit)
9898
error_cnt = error_cnt + 1

0 commit comments

Comments
 (0)