diff options
author | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 19:06:24 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2015-03-22 19:06:24 -0300 |
commit | 95c18c2fad321033830beee880522854a21c7104 (patch) | |
tree | e459a6320c0142bdfe3d35af38f1408f9dcd25ca | |
parent | 23e13ce3c209da13a7bbf771cf31588045ad432e (diff) | |
parent | 0dcca688d26b85ac47291aac6a49bffb4b6ce851 (diff) |
Merge pull request #1545 from okamstudio/revert-1401-inspectorupdate
Revert "Camelcased script variables will now capitalize in the inspector...
-rw-r--r-- | core/ustring.cpp | 25 | ||||
-rw-r--r-- | core/ustring.h | 3 |
2 files changed, 3 insertions, 25 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 497e8f29ed..09d3d95b68 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -482,7 +482,7 @@ void String::erase(int p_pos, int p_chars) { String String::capitalize() const { - String aux=this->camelcase_to_underscore().replace("_"," ").to_lower(); + String aux=this->replace("_"," ").to_lower(); String cap; for (int i=0;i<aux.get_slice_count(" ");i++) { @@ -498,29 +498,6 @@ String String::capitalize() const { return cap; } - - -String String::camelcase_to_underscore() const { - const CharType * cstr = c_str(); - String newString; - const char A = 'A', Z = 'Z'; - int startIndex = 0; - - for ( int i = 1; i < this->size()-1; i++ ) { - bool isCapital = cstr[i] >= A && cstr[i] <= Z; - - if ( isCapital ) { - newString += "_" + this->substr(startIndex, i-startIndex); - startIndex = i; - } - } - - newString += "_" + this->substr(startIndex, this->size()-startIndex); - - return newString; -} - - int String::get_slice_count(String p_splitter) const{ if (empty()) diff --git a/core/ustring.h b/core/ustring.h index f79e5ce306..d4b854ea76 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -149,7 +149,6 @@ public: static double to_double(const CharType* p_str, const CharType **r_end=NULL); static int64_t to_int(const CharType* p_str,int p_len=-1); String capitalize() const; - String camelcase_to_underscore() const; int get_slice_count(String p_splitter) const; String get_slice(String p_splitter,int p_slice) const; @@ -226,6 +225,8 @@ public: String(const char *p_str); String(const CharType *p_str,int p_clip_to_len=-1); String(const StrRange& p_range); + + }; |