diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 00:51:09 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-14 00:51:09 -0300 |
commit | d9d77291bca8dd1e87aa4d9e40de96d99e5ef1f6 (patch) | |
tree | f5c92321612fdd5f8967c349898d3475b52bf930 /core | |
parent | f3b6177ece8a06e52870ed422cbcc67276606e5a (diff) |
rename String.extension() -> String.get_extension() / String.basename() -> String.get_basename()
Diffstat (limited to 'core')
-rw-r--r-- | core/globals.cpp | 2 | ||||
-rw-r--r-- | core/io/file_access_zip.cpp | 2 | ||||
-rw-r--r-- | core/io/image_loader.cpp | 4 | ||||
-rw-r--r-- | core/io/resource_loader.cpp | 14 | ||||
-rw-r--r-- | core/io/resource_saver.cpp | 4 | ||||
-rw-r--r-- | core/io/translation_loader_po.cpp | 2 | ||||
-rw-r--r-- | core/ustring.cpp | 4 | ||||
-rw-r--r-- | core/ustring.h | 4 | ||||
-rw-r--r-- | core/variant_call.cpp | 8 |
9 files changed, 22 insertions, 22 deletions
diff --git a/core/globals.cpp b/core/globals.cpp index 28fabac302..b89303b728 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -329,7 +329,7 @@ Error GlobalConfig::setup(const String& p_path,const String & p_main_pack) { String candidate = d->get_current_dir(); String current_dir = d->get_current_dir(); - String exec_name = OS::get_singleton()->get_executable_path().get_file().basename(); + String exec_name = OS::get_singleton()->get_executable_path().get_file().get_basename(); bool found = false; bool first_time=true; diff --git a/core/io/file_access_zip.cpp b/core/io/file_access_zip.cpp index c4439f2599..87f07cb7b1 100644 --- a/core/io/file_access_zip.cpp +++ b/core/io/file_access_zip.cpp @@ -165,7 +165,7 @@ unzFile ZipArchive::get_file_handle(String p_file) const { bool ZipArchive::try_open_pack(const String& p_name) { //printf("opening zip pack %ls, %i, %i\n", p_name.c_str(), p_name.extension().nocasecmp_to("zip"), p_name.extension().nocasecmp_to("pcz")); - if (p_name.extension().nocasecmp_to("zip") != 0 && p_name.extension().nocasecmp_to("pcz") != 0) + if (p_name.get_extension().nocasecmp_to("zip") != 0 && p_name.get_extension().nocasecmp_to("pcz") != 0) return false; zlib_filefunc_def io; diff --git a/core/io/image_loader.cpp b/core/io/image_loader.cpp index d4d10e2126..2b01e865f4 100644 --- a/core/io/image_loader.cpp +++ b/core/io/image_loader.cpp @@ -36,7 +36,7 @@ bool ImageFormatLoader::recognize(const String& p_extension) const { get_recognized_extensions(&extensions); for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(p_extension.extension())==0) + if (E->get().nocasecmp_to(p_extension.get_extension())==0) return true; } @@ -56,7 +56,7 @@ Error ImageLoader::load_image(String p_file,Image *p_image, FileAccess *p_custom } } - String extension = p_file.extension(); + String extension = p_file.get_extension(); for (int i=0;i<loader_count;i++) { diff --git a/core/io/resource_loader.cpp b/core/io/resource_loader.cpp index cc3c8ce006..777c57a6a6 100644 --- a/core/io/resource_loader.cpp +++ b/core/io/resource_loader.cpp @@ -55,7 +55,7 @@ bool ResourceFormatLoader::recognize(const String& p_extension) const { get_recognized_extensions(&extensions); for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(p_extension.extension())==0) + if (E->get().nocasecmp_to(p_extension.get_extension())==0) return true; } @@ -182,7 +182,7 @@ RES ResourceLoader::load(const String &p_path, const String& p_type_hint, bool p if (OS::get_singleton()->is_stdout_verbose()) print_line("load resource: "+remapped_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); bool found=false; for (int i=0;i<loader_count;i++) { @@ -230,7 +230,7 @@ Ref<ResourceImportMetadata> ResourceLoader::load_import_metadata(const String &p else local_path = GlobalConfig::get_singleton()->localize_path(p_path); - String extension=p_path.extension(); + String extension=p_path.get_extension(); Ref<ResourceImportMetadata> ret; for (int i=0;i<loader_count;i++) { @@ -331,7 +331,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_ String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); bool found=false; for (int i=0;i<loader_count;i++) { @@ -385,7 +385,7 @@ void ResourceLoader::get_dependencies(const String& p_path, List<String> *p_depe String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { @@ -410,7 +410,7 @@ Error ResourceLoader::rename_dependencies(const String &p_path,const Map<String, String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { @@ -449,7 +449,7 @@ String ResourceLoader::get_resource_type(const String &p_path) { local_path = GlobalConfig::get_singleton()->localize_path(p_path); String remapped_path = PathRemap::get_singleton()->get_remap(local_path); - String extension=remapped_path.extension(); + String extension=remapped_path.get_extension(); for (int i=0;i<loader_count;i++) { diff --git a/core/io/resource_saver.cpp b/core/io/resource_saver.cpp index 9081adaa8f..222d3e6bc0 100644 --- a/core/io/resource_saver.cpp +++ b/core/io/resource_saver.cpp @@ -40,7 +40,7 @@ ResourceSavedCallback ResourceSaver::save_callback=0; Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_flags) { - String extension=p_path.extension(); + String extension=p_path.get_extension(); Error err=ERR_FILE_UNRECOGNIZED; for (int i=0;i<saver_count;i++) { @@ -54,7 +54,7 @@ Error ResourceSaver::save(const String &p_path,const RES& p_resource,uint32_t p_ for (List<String>::Element *E=extensions.front();E;E=E->next()) { - if (E->get().nocasecmp_to(extension.extension())==0) + if (E->get().nocasecmp_to(extension.get_extension())==0) recognized=true; } diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 8c4c1c8180..bee38e037f 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -204,7 +204,7 @@ bool TranslationLoaderPO::handles_type(const String& p_type) const{ String TranslationLoaderPO::get_resource_type(const String &p_path) const { - if (p_path.extension().to_lower()=="po") + if (p_path.get_extension().to_lower()=="po") return "Translation"; return ""; } diff --git a/core/ustring.cpp b/core/ustring.cpp index 27bb8eac72..cce355afd5 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3812,7 +3812,7 @@ String String::get_file() const { return substr(sep+1,length()); } -String String::extension() const { +String String::get_extension() const { int pos = find_last("."); if (pos<0) @@ -3891,7 +3891,7 @@ String String::percent_decode() const { return String::utf8(pe.ptr()); } -String String::basename() const { +String String::get_basename() const { int pos = find_last("."); if (pos<0) diff --git a/core/ustring.h b/core/ustring.h index 9a145143d0..674551ec80 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -176,8 +176,8 @@ public: String right(int p_pos) const; String strip_edges(bool left = true, bool right = true) const; String strip_escapes() const; - String extension() const; - String basename() const; + String get_extension() const; + String get_basename() const; String plus_file(const String& p_file) const; CharType ord_at(int p_idx) const; diff --git a/core/variant_call.cpp b/core/variant_call.cpp index b20f8aafd1..f51abe7289 100644 --- a/core/variant_call.cpp +++ b/core/variant_call.cpp @@ -272,8 +272,8 @@ static void _call_##m_type##_##m_method(Variant& r_ret,Variant& p_self,const Var VCALL_LOCALMEM1R(String,left); VCALL_LOCALMEM1R(String,right); VCALL_LOCALMEM2R(String,strip_edges); - VCALL_LOCALMEM0R(String,extension); - VCALL_LOCALMEM0R(String,basename); + VCALL_LOCALMEM0R(String,get_extension); + VCALL_LOCALMEM0R(String,get_basename); VCALL_LOCALMEM1R(String,plus_file); VCALL_LOCALMEM1R(String,ord_at); VCALL_LOCALMEM2(String,erase); @@ -1405,8 +1405,8 @@ _VariantCall::addfunc(Variant::m_vtype,Variant::m_ret,_SCS(#m_method),VCALL(m_cl ADDFUNC1(STRING,STRING,String,left,INT,"pos",varray()); ADDFUNC1(STRING,STRING,String,right,INT,"pos",varray()); ADDFUNC2(STRING,STRING,String,strip_edges,BOOL,"left",BOOL,"right",varray(true,true)); - ADDFUNC0(STRING,STRING,String,extension,varray()); - ADDFUNC0(STRING,STRING,String,basename,varray()); + ADDFUNC0(STRING,STRING,String,get_extension,varray()); + ADDFUNC0(STRING,STRING,String,get_basename,varray()); ADDFUNC1(STRING,STRING,String,plus_file,STRING,"file",varray()); ADDFUNC1(STRING,INT,String,ord_at,INT,"at",varray()); ADDFUNC2(STRING,NIL,String,erase,INT,"pos",INT,"chars", varray()); |