diff options
Diffstat (limited to 'core/ustring.h')
-rw-r--r-- | core/ustring.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/core/ustring.h b/core/ustring.h index e2e62874d6..8a52c53238 100644 --- a/core/ustring.h +++ b/core/ustring.h @@ -201,7 +201,7 @@ public: } /* complex helpers */ - String substr(int p_from, int p_chars) const; + String substr(int p_from, int p_chars = -1) const; int find(const String &p_str, int p_from = 0) const; ///< return <0 if failed int find(const char *p_str, int p_from = 0) const; ///< return <0 if failed int find_char(const CharType &p_char, int p_from = 0) const; ///< return <0 if failed @@ -251,6 +251,7 @@ public: int to_int() const; int64_t hex_to_int64(bool p_with_prefix = true) const; + int64_t bin_to_int64(bool p_with_prefix = true) const; int64_t to_int64() const; static int to_int(const char *p_str, int p_len = -1); static double to_double(const char *p_str); @@ -304,8 +305,10 @@ public: uint32_t hash() const; /* hash the string */ uint64_t hash64() const; /* hash the string */ String md5_text() const; + String sha1_text() const; String sha256_text() const; Vector<uint8_t> md5_buffer() const; + Vector<uint8_t> sha1_buffer() const; Vector<uint8_t> sha256_buffer() const; _FORCE_INLINE_ bool empty() const { return length() == 0; } @@ -403,8 +406,6 @@ _FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) { l_ptr++; r_ptr++; } - - CRASH_COND(true); // unreachable } /* end of namespace */ @@ -414,16 +415,16 @@ _FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) { //gets parsed String TTR(const String &); -//use for c strings -#define TTRC(m_value) m_value +//use for C strings +#define TTRC(m_value) (m_value) //use to avoid parsing (for use later with C strings) #define TTRGET(m_value) TTR(m_value) #else -#define TTR(m_val) (String()) -#define TTRCDEF(m_value) (m_value) +#define TTR(m_value) (String()) #define TTRC(m_value) (m_value) +#define TTRGET(m_value) (m_value) #endif |