@@ -691,130 +691,130 @@ uint64_t FileAccess::get_access_time(const String &p_file) {
691691 return fa->_get_access_time (p_file);
692692}
693693
694- int64_t FileAccess::get_size (const String &p_file ) {
695- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
696- return PackedData::get_singleton ()->get_size (p_file );
694+ int64_t FileAccess::get_size (const String &p_path ) {
695+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
696+ return PackedData::get_singleton ()->get_size (p_path );
697697 }
698698
699- Ref<FileAccess> fa = create_for_path (p_file );
700- ERR_FAIL_COND_V_MSG (fa.is_null (), -1 , " Cannot create FileAccess for path '" + p_file + " '." );
699+ Ref<FileAccess> fa = create_for_path (p_path );
700+ ERR_FAIL_COND_V_MSG (fa.is_null (), -1 , " Cannot create FileAccess for path '" + p_path + " '." );
701701
702- return fa->_get_size (p_file );
702+ return fa->_get_size (p_path );
703703}
704704
705- BitField<FileAccess::UnixPermissionFlags> FileAccess::get_unix_permissions (const String &p_file ) {
706- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
705+ BitField<FileAccess::UnixPermissionFlags> FileAccess::get_unix_permissions (const String &p_path ) {
706+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
707707 return 0 ;
708708 }
709709
710- Ref<FileAccess> fa = create_for_path (p_file );
711- ERR_FAIL_COND_V_MSG (fa.is_null (), 0 , vformat (" Cannot create FileAccess for path '%s'." , p_file ));
710+ Ref<FileAccess> fa = create_for_path (p_path );
711+ ERR_FAIL_COND_V_MSG (fa.is_null (), 0 , vformat (" Cannot create FileAccess for path '%s'." , p_path ));
712712
713- return fa->_get_unix_permissions (p_file );
713+ return fa->_get_unix_permissions (p_path );
714714}
715715
716- Error FileAccess::set_unix_permissions (const String &p_file , BitField<FileAccess::UnixPermissionFlags> p_permissions) {
717- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
716+ Error FileAccess::set_unix_permissions (const String &p_path , BitField<FileAccess::UnixPermissionFlags> p_permissions) {
717+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
718718 return ERR_UNAVAILABLE;
719719 }
720720
721- Ref<FileAccess> fa = create_for_path (p_file );
722- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
721+ Ref<FileAccess> fa = create_for_path (p_path );
722+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
723723
724- Error err = fa->_set_unix_permissions (p_file , p_permissions);
724+ Error err = fa->_set_unix_permissions (p_path , p_permissions);
725725 return err;
726726}
727727
728- bool FileAccess::get_hidden_attribute (const String &p_file ) {
729- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
728+ bool FileAccess::get_hidden_attribute (const String &p_path ) {
729+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
730730 return false ;
731731 }
732732
733- Ref<FileAccess> fa = create_for_path (p_file );
734- ERR_FAIL_COND_V_MSG (fa.is_null (), false , vformat (" Cannot create FileAccess for path '%s'." , p_file ));
733+ Ref<FileAccess> fa = create_for_path (p_path );
734+ ERR_FAIL_COND_V_MSG (fa.is_null (), false , vformat (" Cannot create FileAccess for path '%s'." , p_path ));
735735
736- return fa->_get_hidden_attribute (p_file );
736+ return fa->_get_hidden_attribute (p_path );
737737}
738738
739- Error FileAccess::set_hidden_attribute (const String &p_file , bool p_hidden) {
740- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
739+ Error FileAccess::set_hidden_attribute (const String &p_path , bool p_hidden) {
740+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
741741 return ERR_UNAVAILABLE;
742742 }
743743
744- Ref<FileAccess> fa = create_for_path (p_file );
745- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
744+ Ref<FileAccess> fa = create_for_path (p_path );
745+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
746746
747- Error err = fa->_set_hidden_attribute (p_file , p_hidden);
747+ Error err = fa->_set_hidden_attribute (p_path , p_hidden);
748748 return err;
749749}
750750
751- bool FileAccess::get_read_only_attribute (const String &p_file ) {
752- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
751+ bool FileAccess::get_read_only_attribute (const String &p_path ) {
752+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
753753 return false ;
754754 }
755755
756- Ref<FileAccess> fa = create_for_path (p_file );
757- ERR_FAIL_COND_V_MSG (fa.is_null (), false , vformat (" Cannot create FileAccess for path '%s'." , p_file ));
756+ Ref<FileAccess> fa = create_for_path (p_path );
757+ ERR_FAIL_COND_V_MSG (fa.is_null (), false , vformat (" Cannot create FileAccess for path '%s'." , p_path ));
758758
759- return fa->_get_read_only_attribute (p_file );
759+ return fa->_get_read_only_attribute (p_path );
760760}
761761
762- Error FileAccess::set_read_only_attribute (const String &p_file , bool p_ro) {
763- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
762+ Error FileAccess::set_read_only_attribute (const String &p_path , bool p_ro) {
763+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
764764 return ERR_UNAVAILABLE;
765765 }
766766
767- Ref<FileAccess> fa = create_for_path (p_file );
768- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
767+ Ref<FileAccess> fa = create_for_path (p_path );
768+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
769769
770- Error err = fa->_set_read_only_attribute (p_file , p_ro);
770+ Error err = fa->_set_read_only_attribute (p_path , p_ro);
771771 return err;
772772}
773773
774- PackedByteArray FileAccess::get_extended_attribute (const String &p_file , const String &p_attribute_name) {
775- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
774+ PackedByteArray FileAccess::get_extended_attribute (const String &p_path , const String &p_attribute_name) {
775+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
776776 return PackedByteArray ();
777777 }
778778
779- Ref<FileAccess> fa = create_for_path (p_file );
780- ERR_FAIL_COND_V_MSG (fa.is_null (), PackedByteArray (), vformat (" Cannot create FileAccess for path '%s'." , p_file ));
779+ Ref<FileAccess> fa = create_for_path (p_path );
780+ ERR_FAIL_COND_V_MSG (fa.is_null (), PackedByteArray (), vformat (" Cannot create FileAccess for path '%s'." , p_path ));
781781
782- return fa->_get_extended_attribute (p_file , p_attribute_name);
782+ return fa->_get_extended_attribute (p_path , p_attribute_name);
783783}
784784
785- String FileAccess::get_extended_attribute_string (const String &p_file , const String &p_attribute_name) {
786- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
785+ String FileAccess::get_extended_attribute_string (const String &p_path , const String &p_attribute_name) {
786+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
787787 return String ();
788788 }
789789
790- Ref<FileAccess> fa = create_for_path (p_file );
791- ERR_FAIL_COND_V_MSG (fa.is_null (), String (), vformat (" Cannot create FileAccess for path '%s'." , p_file ));
790+ Ref<FileAccess> fa = create_for_path (p_path );
791+ ERR_FAIL_COND_V_MSG (fa.is_null (), String (), vformat (" Cannot create FileAccess for path '%s'." , p_path ));
792792
793- PackedByteArray data = fa->_get_extended_attribute (p_file , p_attribute_name);
793+ PackedByteArray data = fa->_get_extended_attribute (p_path , p_attribute_name);
794794 if (data.is_empty ()) {
795795 return String ();
796796 }
797797 return String::utf8 ((const char *)data.ptr (), data.size ());
798798}
799799
800- Error FileAccess::set_extended_attribute (const String &p_file , const String &p_attribute_name, const PackedByteArray &p_data) {
801- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
800+ Error FileAccess::set_extended_attribute (const String &p_path , const String &p_attribute_name, const PackedByteArray &p_data) {
801+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
802802 return ERR_UNAVAILABLE;
803803 }
804804
805- Ref<FileAccess> fa = create_for_path (p_file );
806- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
805+ Ref<FileAccess> fa = create_for_path (p_path );
806+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
807807
808- return fa->_set_extended_attribute (p_file , p_attribute_name, p_data);
808+ return fa->_set_extended_attribute (p_path , p_attribute_name, p_data);
809809}
810810
811- Error FileAccess::set_extended_attribute_string (const String &p_file , const String &p_attribute_name, const String &p_data) {
812- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
811+ Error FileAccess::set_extended_attribute_string (const String &p_path , const String &p_attribute_name, const String &p_data) {
812+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
813813 return ERR_UNAVAILABLE;
814814 }
815815
816- Ref<FileAccess> fa = create_for_path (p_file );
817- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
816+ Ref<FileAccess> fa = create_for_path (p_path );
817+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
818818
819819 PackedByteArray data;
820820 CharString cs = p_data.utf8 ();
@@ -823,29 +823,29 @@ Error FileAccess::set_extended_attribute_string(const String &p_file, const Stri
823823 memcpy (data.ptrw (), cs.get_data (), cs.size ());
824824 }
825825
826- return fa->_set_extended_attribute (p_file , p_attribute_name, data);
826+ return fa->_set_extended_attribute (p_path , p_attribute_name, data);
827827}
828828
829- Error FileAccess::remove_extended_attribute (const String &p_file , const String &p_attribute_name) {
830- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
829+ Error FileAccess::remove_extended_attribute (const String &p_path , const String &p_attribute_name) {
830+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
831831 return ERR_UNAVAILABLE;
832832 }
833833
834- Ref<FileAccess> fa = create_for_path (p_file );
835- ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_file ));
834+ Ref<FileAccess> fa = create_for_path (p_path );
835+ ERR_FAIL_COND_V_MSG (fa.is_null (), ERR_CANT_CREATE, vformat (" Cannot create FileAccess for path '%s'." , p_path ));
836836
837- return fa->_remove_extended_attribute (p_file , p_attribute_name);
837+ return fa->_remove_extended_attribute (p_path , p_attribute_name);
838838}
839839
840- PackedStringArray FileAccess::get_extended_attributes_list (const String &p_file ) {
841- if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_file ) || PackedData::get_singleton ()->has_directory (p_file ))) {
840+ PackedStringArray FileAccess::get_extended_attributes_list (const String &p_path ) {
841+ if (PackedData::get_singleton () && !PackedData::get_singleton ()->is_disabled () && (PackedData::get_singleton ()->has_path (p_path ) || PackedData::get_singleton ()->has_directory (p_path ))) {
842842 return PackedStringArray ();
843843 }
844844
845- Ref<FileAccess> fa = create_for_path (p_file );
846- ERR_FAIL_COND_V_MSG (fa.is_null (), PackedStringArray (), vformat (" Cannot create FileAccess for path '%s'." , p_file ));
845+ Ref<FileAccess> fa = create_for_path (p_path );
846+ ERR_FAIL_COND_V_MSG (fa.is_null (), PackedStringArray (), vformat (" Cannot create FileAccess for path '%s'." , p_path ));
847847
848- return fa->_get_extended_attributes_list (p_file );
848+ return fa->_get_extended_attributes_list (p_path );
849849}
850850
851851bool FileAccess::store_string (const String &p_string) {
@@ -1109,22 +1109,22 @@ void FileAccess::_bind_methods() {
11091109 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" file_exists" , " path" ), &FileAccess::exists);
11101110 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_modified_time" , " file" ), &FileAccess::get_modified_time);
11111111 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_access_time" , " file" ), &FileAccess::get_access_time);
1112- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_size" , " file " ), &FileAccess::get_size);
1112+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_size" , " path " ), &FileAccess::get_size);
11131113
1114- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_unix_permissions" , " file " ), &FileAccess::get_unix_permissions);
1115- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_unix_permissions" , " file " , " permissions" ), &FileAccess::set_unix_permissions);
1114+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_unix_permissions" , " path " ), &FileAccess::get_unix_permissions);
1115+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_unix_permissions" , " path " , " permissions" ), &FileAccess::set_unix_permissions);
11161116
1117- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_hidden_attribute" , " file " ), &FileAccess::get_hidden_attribute);
1118- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_hidden_attribute" , " file " , " hidden" ), &FileAccess::set_hidden_attribute);
1119- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_read_only_attribute" , " file " , " ro" ), &FileAccess::set_read_only_attribute);
1120- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_read_only_attribute" , " file " ), &FileAccess::get_read_only_attribute);
1117+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_hidden_attribute" , " path " ), &FileAccess::get_hidden_attribute);
1118+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_hidden_attribute" , " path " , " hidden" ), &FileAccess::set_hidden_attribute);
1119+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_read_only_attribute" , " path " , " ro" ), &FileAccess::set_read_only_attribute);
1120+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_read_only_attribute" , " path " ), &FileAccess::get_read_only_attribute);
11211121
11221122 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_extended_attribute" , " file" , " attribute_name" ), &FileAccess::get_extended_attribute);
11231123 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_extended_attribute_string" , " file" , " attribute_name" ), &FileAccess::get_extended_attribute_string);
11241124 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_extended_attribute" , " file" , " attribute_name" , " data" ), &FileAccess::set_extended_attribute);
11251125 ClassDB::bind_static_method (" FileAccess" , D_METHOD (" set_extended_attribute_string" , " file" , " attribute_name" , " _data" ), &FileAccess::set_extended_attribute_string);
1126- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" remove_extended_attribute" , " file " , " attribute_name" ), &FileAccess::remove_extended_attribute);
1127- ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_extended_attributes_list" , " file " ), &FileAccess::get_extended_attributes_list);
1126+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" remove_extended_attribute" , " path " , " attribute_name" ), &FileAccess::remove_extended_attribute);
1127+ ClassDB::bind_static_method (" FileAccess" , D_METHOD (" get_extended_attributes_list" , " path " ), &FileAccess::get_extended_attributes_list);
11281128
11291129 ADD_PROPERTY (PropertyInfo (Variant::BOOL, " big_endian" ), " set_big_endian" , " is_big_endian" );
11301130
0 commit comments