| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | /*************************************************************************/ | 
					
						
							|  |  |  | /*  ustring.h                                                            */ | 
					
						
							|  |  |  | /*************************************************************************/ | 
					
						
							|  |  |  | /*                       This file is part of:                           */ | 
					
						
							|  |  |  | /*                           GODOT ENGINE                                */ | 
					
						
							| 
									
										
										
										
											2017-08-27 14:16:55 +02:00
										 |  |  | /*                      https://godotengine.org                          */ | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | /*************************************************************************/ | 
					
						
							| 
									
										
										
										
											2022-01-13 09:45:09 +01:00
										 |  |  | /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */ | 
					
						
							|  |  |  | /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */ | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the       */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including   */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,   */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to    */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to */ | 
					
						
							|  |  |  | /* the following conditions:                                             */ | 
					
						
							|  |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be        */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.       */ | 
					
						
							|  |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */ | 
					
						
							|  |  |  | /*************************************************************************/ | 
					
						
							| 
									
										
										
										
											2018-01-05 00:50:27 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-11 18:13:45 +02:00
										 |  |  | #ifndef USTRING_H
 | 
					
						
							|  |  |  | #define USTRING_H
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-11 18:13:45 +02:00
										 |  |  | #include "core/array.h"
 | 
					
						
							|  |  |  | #include "core/cowdata.h"
 | 
					
						
							|  |  |  | #include "core/typedefs.h"
 | 
					
						
							|  |  |  | #include "core/vector.h"
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | template <class T> | 
					
						
							|  |  |  | class CharProxy { | 
					
						
							|  |  |  | 	friend class CharString; | 
					
						
							|  |  |  | 	friend class String; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	const int _index; | 
					
						
							|  |  |  | 	CowData<T> &_cowdata; | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 	static const T _null = 0; | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-30 23:02:41 +02:00
										 |  |  | 	_FORCE_INLINE_ CharProxy(const int &p_index, CowData<T> &p_cowdata) : | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 			_index(p_index), | 
					
						
							| 
									
										
										
										
											2021-09-30 23:02:41 +02:00
										 |  |  | 			_cowdata(p_cowdata) {} | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2021-09-30 23:02:41 +02:00
										 |  |  | 	_FORCE_INLINE_ CharProxy(const CharProxy<T> &p_other) : | 
					
						
							|  |  |  | 			_index(p_other._index), | 
					
						
							|  |  |  | 			_cowdata(p_other._cowdata) {} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 	_FORCE_INLINE_ operator T() const { | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		if (unlikely(_index == _cowdata.size())) { | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 			return _null; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 		return _cowdata.get(_index); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	_FORCE_INLINE_ const T *operator&() const { | 
					
						
							|  |  |  | 		return _cowdata.ptr() + _index; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-30 23:02:41 +02:00
										 |  |  | 	_FORCE_INLINE_ void operator=(const T &p_other) const { | 
					
						
							|  |  |  | 		_cowdata.set(_index, p_other); | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-30 23:02:41 +02:00
										 |  |  | 	_FORCE_INLINE_ void operator=(const CharProxy<T> &p_other) const { | 
					
						
							|  |  |  | 		_cowdata.set(_index, p_other.operator T()); | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | class CharString { | 
					
						
							|  |  |  | 	CowData<char> _cowdata; | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 	static const char _null; | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-03-09 00:00:52 +01:00
										 |  |  | public: | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	_FORCE_INLINE_ char *ptrw() { return _cowdata.ptrw(); } | 
					
						
							|  |  |  | 	_FORCE_INLINE_ const char *ptr() const { return _cowdata.ptr(); } | 
					
						
							|  |  |  | 	_FORCE_INLINE_ int size() const { return _cowdata.size(); } | 
					
						
							|  |  |  | 	Error resize(int p_size) { return _cowdata.resize(p_size); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-21 20:24:29 +01:00
										 |  |  | 	_FORCE_INLINE_ char get(int p_index) const { return _cowdata.get(p_index); } | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	_FORCE_INLINE_ void set(int p_index, const char &p_elem) { _cowdata.set(p_index, p_elem); } | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 	_FORCE_INLINE_ const char &operator[](int p_index) const { | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		if (unlikely(p_index == _cowdata.size())) { | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 			return _null; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		return _cowdata.get(p_index); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 	_FORCE_INLINE_ CharProxy<char> operator[](int p_index) { return CharProxy<char>(p_index, _cowdata); } | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	_FORCE_INLINE_ CharString() {} | 
					
						
							|  |  |  | 	_FORCE_INLINE_ CharString(const CharString &p_str) { _cowdata._ref(p_str._cowdata); } | 
					
						
							| 
									
										
										
										
											2019-03-02 13:32:29 +01:00
										 |  |  | 	_FORCE_INLINE_ CharString operator=(const CharString &p_str) { | 
					
						
							|  |  |  | 		_cowdata._ref(p_str._cowdata); | 
					
						
							|  |  |  | 		return *this; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2019-03-12 12:57:22 +00:00
										 |  |  | 	_FORCE_INLINE_ CharString(const char *p_cstr) { copy_from(p_cstr); } | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-03-12 12:57:22 +00:00
										 |  |  | 	CharString &operator=(const char *p_cstr); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool operator<(const CharString &p_right) const; | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	CharString &operator+=(char p_char); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	int length() const { return size() ? size() - 1 : 0; } | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	const char *get_data() const; | 
					
						
							| 
									
										
										
										
											2018-12-03 20:25:23 +00:00
										 |  |  | 	operator const char *() const { return get_data(); }; | 
					
						
							| 
									
										
										
										
											2019-03-12 12:57:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | protected: | 
					
						
							|  |  |  | 	void copy_from(const char *p_cstr); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | typedef wchar_t CharType; | 
					
						
							| 
									
										
										
										
											2016-06-19 00:05:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | struct StrRange { | 
					
						
							|  |  |  | 	const CharType *c_str; | 
					
						
							|  |  |  | 	int len; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-04 16:00:45 +02:00
										 |  |  | 	StrRange(const CharType *p_c_str = nullptr, int p_len = 0) { | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 		c_str = p_c_str; | 
					
						
							|  |  |  | 		len = p_len; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | class String { | 
					
						
							|  |  |  | 	CowData<CharType> _cowdata; | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 	static const CharType _null; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	void copy_from(const char *p_cstr); | 
					
						
							| 
									
										
										
										
											2018-08-06 23:51:07 +02:00
										 |  |  | 	void copy_from(const CharType *p_cstr, const int p_clip_to = -1); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	void copy_from(const CharType &p_char); | 
					
						
							| 
									
										
										
										
											2018-08-06 23:51:07 +02:00
										 |  |  | 	void copy_from_unchecked(const CharType *p_char, const int p_length); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool _base_is_subsequence_of(const String &p_string, bool case_insensitive) const; | 
					
						
							| 
									
										
										
										
											2019-01-18 11:29:28 +03:00
										 |  |  | 	int _count(const String &p_string, int p_from, int p_to, bool p_case_insensitive) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 	enum { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 		npos = -1 ///<for "some" compatibility with std::string (npos is a huge value in std::string)
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	}; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	_FORCE_INLINE_ CharType *ptrw() { return _cowdata.ptrw(); } | 
					
						
							|  |  |  | 	_FORCE_INLINE_ const CharType *ptr() const { return _cowdata.ptr(); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void remove(int p_index) { _cowdata.remove(p_index); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	_FORCE_INLINE_ void clear() { resize(0); } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-21 20:24:29 +01:00
										 |  |  | 	_FORCE_INLINE_ CharType get(int p_index) const { return _cowdata.get(p_index); } | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	_FORCE_INLINE_ void set(int p_index, const CharType &p_elem) { _cowdata.set(p_index, p_elem); } | 
					
						
							|  |  |  | 	_FORCE_INLINE_ int size() const { return _cowdata.size(); } | 
					
						
							|  |  |  | 	Error resize(int p_size) { return _cowdata.resize(p_size); } | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 	_FORCE_INLINE_ const CharType &operator[](int p_index) const { | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		if (unlikely(p_index == _cowdata.size())) { | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 			return _null; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2019-01-04 16:01:54 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		return _cowdata.get(p_index); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-12-16 00:44:18 +00:00
										 |  |  | 	_FORCE_INLINE_ CharProxy<CharType> operator[](int p_index) { return CharProxy<CharType>(p_index, _cowdata); } | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool operator==(const String &p_str) const; | 
					
						
							|  |  |  | 	bool operator!=(const String &p_str) const; | 
					
						
							|  |  |  | 	String operator+(const String &p_str) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	//String operator+(CharType p_char) const;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String &operator+=(const String &); | 
					
						
							| 
									
										
										
										
											2017-08-11 15:10:05 -04:00
										 |  |  | 	String &operator+=(CharType p_char); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String &operator+=(const char *p_str); | 
					
						
							|  |  |  | 	String &operator+=(const CharType *p_str); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* Compatibility Operators */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void operator=(const char *p_str); | 
					
						
							|  |  |  | 	void operator=(const CharType *p_str); | 
					
						
							|  |  |  | 	bool operator==(const char *p_str) const; | 
					
						
							|  |  |  | 	bool operator==(const CharType *p_str) const; | 
					
						
							|  |  |  | 	bool operator==(const StrRange &p_str_range) const; | 
					
						
							|  |  |  | 	bool operator!=(const char *p_str) const; | 
					
						
							|  |  |  | 	bool operator!=(const CharType *p_str) const; | 
					
						
							|  |  |  | 	bool operator<(const CharType *p_str) const; | 
					
						
							|  |  |  | 	bool operator<(const char *p_str) const; | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	bool operator<(const String &p_str) const; | 
					
						
							|  |  |  | 	bool operator<=(const String &p_str) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	signed char casecmp_to(const String &p_str) const; | 
					
						
							|  |  |  | 	signed char nocasecmp_to(const String &p_str) const; | 
					
						
							| 
									
										
										
										
											2017-05-11 20:07:59 +01:00
										 |  |  | 	signed char naturalnocasecmp_to(const String &p_str) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	const CharType *c_str() const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	/* standard size stuff */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	_FORCE_INLINE_ int length() const { | 
					
						
							|  |  |  | 		int s = size(); | 
					
						
							|  |  |  | 		return s ? (s - 1) : 0; // length does not include zero
 | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/* complex helpers */ | 
					
						
							| 
									
										
										
										
											2019-05-03 14:21:04 +02:00
										 |  |  | 	String substr(int p_from, int p_chars = -1) const; | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	int find(const String &p_str, int p_from = 0) const; ///< return <0 if failed
 | 
					
						
							| 
									
										
										
										
											2019-01-07 17:02:55 +00:00
										 |  |  | 	int find(const char *p_str, int p_from = 0) const; ///< return <0 if failed
 | 
					
						
							| 
									
										
										
										
											2019-02-21 20:24:29 +01:00
										 |  |  | 	int find_char(const CharType &p_char, int p_from = 0) const; ///< return <0 if failed
 | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	int find_last(const String &p_str) const; ///< return <0 if failed
 | 
					
						
							|  |  |  | 	int findn(const String &p_str, int p_from = 0) const; ///< return <0 if failed, case insensitive
 | 
					
						
							|  |  |  | 	int rfind(const String &p_str, int p_from = -1) const; ///< return <0 if failed
 | 
					
						
							|  |  |  | 	int rfindn(const String &p_str, int p_from = -1) const; ///< return <0 if failed, case insensitive
 | 
					
						
							| 
									
										
										
										
											2021-05-04 16:00:45 +02:00
										 |  |  | 	int findmk(const Vector<String> &p_keys, int p_from = 0, int *r_key = nullptr) const; ///< return <0 if failed
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool match(const String &p_wildcard) const; | 
					
						
							|  |  |  | 	bool matchn(const String &p_wildcard) const; | 
					
						
							|  |  |  | 	bool begins_with(const String &p_string) const; | 
					
						
							|  |  |  | 	bool begins_with(const char *p_string) const; | 
					
						
							|  |  |  | 	bool ends_with(const String &p_string) const; | 
					
						
							| 
									
										
										
										
											2017-10-28 23:46:20 +02:00
										 |  |  | 	bool is_enclosed_in(const String &p_string) const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool is_subsequence_of(const String &p_string) const; | 
					
						
							|  |  |  | 	bool is_subsequence_ofi(const String &p_string) const; | 
					
						
							| 
									
										
										
										
											2017-10-28 23:46:20 +02:00
										 |  |  | 	bool is_quoted() const; | 
					
						
							| 
									
										
										
										
											2016-06-13 14:06:03 -03:00
										 |  |  | 	Vector<String> bigrams() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	float similarity(const String &p_string) const; | 
					
						
							|  |  |  | 	String format(const Variant &values, String placeholder = "{_}") const; | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	String replace_first(const String &p_key, const String &p_with) const; | 
					
						
							|  |  |  | 	String replace(const String &p_key, const String &p_with) const; | 
					
						
							|  |  |  | 	String replace(const char *p_key, const char *p_with) const; | 
					
						
							|  |  |  | 	String replacen(const String &p_key, const String &p_with) const; | 
					
						
							| 
									
										
										
										
											2019-09-01 23:49:55 -04:00
										 |  |  | 	String repeat(int p_count) const; | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	String insert(int p_at_pos, const String &p_string) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String pad_decimals(int p_digits) const; | 
					
						
							|  |  |  | 	String pad_zeros(int p_digits) const; | 
					
						
							| 
									
										
										
										
											2018-04-13 17:40:27 +03:00
										 |  |  | 	String trim_prefix(const String &p_prefix) const; | 
					
						
							|  |  |  | 	String trim_suffix(const String &p_suffix) const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String lpad(int min_length, const String &character = " ") const; | 
					
						
							|  |  |  | 	String rpad(int min_length, const String &character = " ") const; | 
					
						
							|  |  |  | 	String sprintf(const Array &values, bool *error) const; | 
					
						
							| 
									
										
										
										
											2017-10-28 23:46:20 +02:00
										 |  |  | 	String quote(String quotechar = "\"") const; | 
					
						
							|  |  |  | 	String unquote() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	static String num(double p_num, int p_decimals = -1); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	static String num_scientific(double p_num); | 
					
						
							|  |  |  | 	static String num_real(double p_num); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	static String num_int64(int64_t p_num, int base = 10, bool capitalize_hex = false); | 
					
						
							| 
									
										
										
										
											2018-02-22 13:13:51 +01:00
										 |  |  | 	static String num_uint64(uint64_t p_num, int base = 10, bool capitalize_hex = false); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	static String chr(CharType p_char); | 
					
						
							|  |  |  | 	static String md5(const uint8_t *p_md5); | 
					
						
							| 
									
										
										
										
											2016-06-17 10:55:16 +03:00
										 |  |  | 	static String hex_encode_buffer(const uint8_t *p_buffer, int p_len); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	bool is_numeric() const; | 
					
						
							|  |  |  | 	double to_double() const; | 
					
						
							|  |  |  | 	float to_float() const; | 
					
						
							| 
									
										
										
										
											2016-10-20 09:58:00 -03:00
										 |  |  | 	int hex_to_int(bool p_with_prefix = true) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	int to_int() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-01-08 20:58:39 -03:00
										 |  |  | 	int64_t hex_to_int64(bool p_with_prefix = true) const; | 
					
						
							| 
									
										
										
										
											2019-04-25 13:43:48 +01:00
										 |  |  | 	int64_t bin_to_int64(bool p_with_prefix = true) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	int64_t to_int64() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	static int to_int(const char *p_str, int p_len = -1); | 
					
						
							|  |  |  | 	static double to_double(const char *p_str); | 
					
						
							| 
									
										
										
										
											2021-05-04 16:00:45 +02:00
										 |  |  | 	static double to_double(const CharType *p_str, const CharType **r_end = nullptr); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	static int64_t to_int(const CharType *p_str, int p_len = -1); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String capitalize() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String camelcase_to_underscore(bool lowercase = true) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	int get_slice_count(String p_splitter) const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String get_slice(String p_splitter, int p_slice) const; | 
					
						
							| 
									
										
										
										
											2017-08-11 15:10:05 -04:00
										 |  |  | 	String get_slicec(CharType p_splitter, int p_slice) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-12 05:14:38 +03:00
										 |  |  | 	Vector<String> split(const String &p_splitter, bool p_allow_empty = true, int p_maxsplit = 0) const; | 
					
						
							| 
									
										
										
										
											2017-12-15 22:23:58 +03:00
										 |  |  | 	Vector<String> rsplit(const String &p_splitter, bool p_allow_empty = true, int p_maxsplit = 0) const; | 
					
						
							| 
									
										
										
										
											2014-10-09 19:44:27 -03:00
										 |  |  | 	Vector<String> split_spaces() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	Vector<float> split_floats(const String &p_splitter, bool p_allow_empty = true) const; | 
					
						
							|  |  |  | 	Vector<float> split_floats_mk(const Vector<String> &p_splitters, bool p_allow_empty = true) const; | 
					
						
							|  |  |  | 	Vector<int> split_ints(const String &p_splitter, bool p_allow_empty = true) const; | 
					
						
							|  |  |  | 	Vector<int> split_ints_mk(const Vector<String> &p_splitters, bool p_allow_empty = true) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-10-02 22:01:43 +07:00
										 |  |  | 	String join(Vector<String> parts); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	static CharType char_uppercase(CharType p_char); | 
					
						
							|  |  |  | 	static CharType char_lowercase(CharType p_char); | 
					
						
							|  |  |  | 	String to_upper() const; | 
					
						
							|  |  |  | 	String to_lower() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-18 11:29:28 +03:00
										 |  |  | 	int count(const String &p_string, int p_from = 0, int p_to = 0) const; | 
					
						
							|  |  |  | 	int countn(const String &p_string, int p_from = 0, int p_to = 0) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String left(int p_pos) const; | 
					
						
							|  |  |  | 	String right(int p_pos) const; | 
					
						
							| 
									
										
										
										
											2021-12-16 18:22:44 +08:00
										 |  |  | 	String indent(const String &p_prefix) const; | 
					
						
							| 
									
										
										
										
											2017-10-11 16:27:54 +08:00
										 |  |  | 	String dedent() const; | 
					
						
							| 
									
										
										
										
											2016-05-11 09:22:59 +02:00
										 |  |  | 	String strip_edges(bool left = true, bool right = true) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String strip_escapes() const; | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 	String lstrip(const String &p_chars) const; | 
					
						
							|  |  |  | 	String rstrip(const String &p_chars) const; | 
					
						
							| 
									
										
										
										
											2017-01-14 00:51:09 -03:00
										 |  |  | 	String get_extension() const; | 
					
						
							|  |  |  | 	String get_basename() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String plus_file(const String &p_file) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	CharType ord_at(int p_idx) const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	void erase(int p_pos, int p_chars); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	CharString ascii(bool p_allow_extended = false) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	CharString utf8() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool parse_utf8(const char *p_utf8, int p_len = -1); //return true on error
 | 
					
						
							|  |  |  | 	static String utf8(const char *p_utf8, int p_len = -1); | 
					
						
							| 
									
										
										
										
											2016-03-09 00:00:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-08-11 15:10:05 -04:00
										 |  |  | 	static uint32_t hash(const CharType *p_cstr, int p_len); /* hash the string */ | 
					
						
							|  |  |  | 	static uint32_t hash(const CharType *p_cstr); /* hash the string */ | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	static uint32_t hash(const char *p_cstr, int p_len); /* hash the string */ | 
					
						
							|  |  |  | 	static uint32_t hash(const char *p_cstr); /* hash the string */ | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	uint32_t hash() const; /* hash the string */ | 
					
						
							| 
									
										
										
										
											2016-03-09 00:00:52 +01:00
										 |  |  | 	uint64_t hash64() const; /* hash the string */ | 
					
						
							| 
									
										
										
										
											2014-03-13 22:57:24 -03:00
										 |  |  | 	String md5_text() const; | 
					
						
							| 
									
										
										
										
											2019-07-02 16:07:02 +02:00
										 |  |  | 	String sha1_text() const; | 
					
						
							| 
									
										
										
										
											2016-06-17 10:55:16 +03:00
										 |  |  | 	String sha256_text() const; | 
					
						
							| 
									
										
										
										
											2014-08-01 22:10:38 -03:00
										 |  |  | 	Vector<uint8_t> md5_buffer() const; | 
					
						
							| 
									
										
										
										
											2019-07-02 16:07:02 +02:00
										 |  |  | 	Vector<uint8_t> sha1_buffer() const; | 
					
						
							| 
									
										
										
										
											2016-06-23 13:57:45 -03:00
										 |  |  | 	Vector<uint8_t> sha256_buffer() const; | 
					
						
							| 
									
										
										
										
											2014-08-01 22:10:38 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-11 23:38:07 +01:00
										 |  |  | 	_FORCE_INLINE_ bool empty() const { return length() == 0; } | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	// path functions
 | 
					
						
							|  |  |  | 	bool is_abs_path() const; | 
					
						
							|  |  |  | 	bool is_rel_path() const; | 
					
						
							|  |  |  | 	bool is_resource_file() const; | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String path_to(const String &p_path) const; | 
					
						
							|  |  |  | 	String path_to_file(const String &p_path) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String get_base_dir() const; | 
					
						
							|  |  |  | 	String get_file() const; | 
					
						
							| 
									
										
										
										
											2019-10-04 14:35:01 +03:00
										 |  |  | 	static String humanize_size(uint64_t p_size); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String simplify_path() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String xml_escape(bool p_escape_quotes = false) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String xml_unescape() const; | 
					
						
							| 
									
										
										
										
											2018-04-12 21:12:34 +02:00
										 |  |  | 	String http_escape() const; | 
					
						
							|  |  |  | 	String http_unescape() const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String c_escape() const; | 
					
						
							| 
									
										
										
										
											2017-01-16 18:03:38 +01:00
										 |  |  | 	String c_escape_multiline() const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String c_unescape() const; | 
					
						
							| 
									
										
										
										
											2016-01-10 15:01:06 -03:00
										 |  |  | 	String json_escape() const; | 
					
						
							| 
									
										
										
										
											2016-09-30 03:28:05 +09:00
										 |  |  | 	String word_wrap(int p_chars_per_line) const; | 
					
						
							| 
									
										
										
										
											2021-04-26 09:33:28 +02:00
										 |  |  | 	Error parse_url(String &r_scheme, String &r_host, int &r_port, String &r_path) const; | 
					
						
							| 
									
										
										
										
											2016-03-09 00:00:52 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-04-12 21:12:34 +02:00
										 |  |  | 	String percent_encode() const; | 
					
						
							|  |  |  | 	String percent_decode() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-20 10:03:15 +08:00
										 |  |  | 	String property_name_encode() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-28 11:43:49 -08:00
										 |  |  | 	// node functions
 | 
					
						
							|  |  |  | 	static const String invalid_node_name_characters; | 
					
						
							|  |  |  | 	String validate_node_name() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	bool is_valid_identifier() const; | 
					
						
							|  |  |  | 	bool is_valid_integer() const; | 
					
						
							|  |  |  | 	bool is_valid_float() const; | 
					
						
							| 
									
										
										
										
											2016-10-20 09:58:00 -03:00
										 |  |  | 	bool is_valid_hex_number(bool p_with_prefix) const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	bool is_valid_html_color() const; | 
					
						
							|  |  |  | 	bool is_valid_ip_address() const; | 
					
						
							| 
									
										
										
										
											2019-04-08 19:18:03 -03:00
										 |  |  | 	bool is_valid_filename() const; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	/**
 | 
					
						
							|  |  |  | 	 * The constructors must not depend on other overloads | 
					
						
							|  |  |  | 	 */ | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	/*	String(CharType p_char);*/ | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	_FORCE_INLINE_ String() {} | 
					
						
							|  |  |  | 	_FORCE_INLINE_ String(const String &p_str) { _cowdata._ref(p_str._cowdata); } | 
					
						
							| 
									
										
										
										
											2019-03-02 13:32:29 +01:00
										 |  |  | 	String operator=(const String &p_str) { | 
					
						
							|  |  |  | 		_cowdata._ref(p_str._cowdata); | 
					
						
							|  |  |  | 		return *this; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2018-07-25 03:11:03 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	String(const char *p_str); | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	String(const CharType *p_str, int p_clip_to_len = -1); | 
					
						
							|  |  |  | 	String(const StrRange &p_range); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | bool operator==(const char *p_chr, const String &p_str); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | String operator+(const char *p_chr, const String &p_str); | 
					
						
							|  |  |  | String operator+(CharType p_chr, const String &p_str); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							|  |  |  | String itos(int64_t p_val); | 
					
						
							| 
									
										
										
										
											2019-11-01 16:16:31 +01:00
										 |  |  | String uitos(uint64_t p_val); | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | String rtos(double p_val); | 
					
						
							|  |  |  | String rtoss(double p_val); //scientific version
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct NoCaseComparator { | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | 	bool operator()(const String &p_a, const String &p_b) const { | 
					
						
							|  |  |  | 		return p_a.nocasecmp_to(p_b) < 0; | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-11 20:07:59 +01:00
										 |  |  | struct NaturalNoCaseComparator { | 
					
						
							|  |  |  | 	bool operator()(const String &p_a, const String &p_b) const { | 
					
						
							|  |  |  | 		return p_a.naturalnocasecmp_to(p_b) < 0; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | template <typename L, typename R> | 
					
						
							|  |  |  | _FORCE_INLINE_ bool is_str_less(const L *l_ptr, const R *r_ptr) { | 
					
						
							|  |  |  | 	while (true) { | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		if (*l_ptr == 0 && *r_ptr == 0) { | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 			return false; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} else if (*l_ptr == 0) { | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 			return true; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} else if (*r_ptr == 0) { | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 			return false; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} else if (*l_ptr < *r_ptr) { | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 			return true; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} else if (*l_ptr > *r_ptr) { | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 			return false; | 
					
						
							| 
									
										
										
										
											2021-05-05 12:44:11 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2017-12-16 15:31:30 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		l_ptr++; | 
					
						
							|  |  |  | 		r_ptr++; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | /* end of namespace */ | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | // Tool translate (TTR and variants) for the editor UI,
 | 
					
						
							|  |  |  | // and doc translate for the class reference (DTR).
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:27:15 -03:00
										 |  |  | #ifdef TOOLS_ENABLED
 | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | // Gets parsed.
 | 
					
						
							| 
									
										
										
										
											2022-03-16 14:45:30 +08:00
										 |  |  | String TTR(const String &p_text, const String &p_context = ""); | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | String DTR(const String &); | 
					
						
							|  |  |  | // Use for C strings.
 | 
					
						
							| 
									
										
										
										
											2019-06-16 21:57:34 +02:00
										 |  |  | #define TTRC(m_value) (m_value)
 | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | // Use to avoid parsing (for use later with C strings).
 | 
					
						
							| 
									
										
										
										
											2019-04-08 19:18:03 -03:00
										 |  |  | #define TTRGET(m_value) TTR(m_value)
 | 
					
						
							| 
									
										
										
										
											2014-02-09 22:10:30 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:27:15 -03:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2019-06-16 21:57:34 +02:00
										 |  |  | #define TTR(m_value) (String())
 | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | #define DTR(m_value) (String())
 | 
					
						
							| 
									
										
										
										
											2019-04-08 19:18:03 -03:00
										 |  |  | #define TTRC(m_value) (m_value)
 | 
					
						
							| 
									
										
										
										
											2019-06-16 21:57:34 +02:00
										 |  |  | #define TTRGET(m_value) (m_value)
 | 
					
						
							| 
									
										
										
										
											2016-05-17 18:27:15 -03:00
										 |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-03-18 18:34:36 +01:00
										 |  |  | // Runtime translate for the public node API.
 | 
					
						
							| 
									
										
										
										
											2017-03-05 16:44:50 +01:00
										 |  |  | String RTR(const String &); | 
					
						
							| 
									
										
										
										
											2016-05-17 18:27:15 -03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-23 09:59:54 +01:00
										 |  |  | bool is_symbol(CharType c); | 
					
						
							|  |  |  | bool select_word(const String &p_s, int p_col, int &r_beg, int &r_end); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-09-11 18:13:45 +02:00
										 |  |  | #endif // USTRING_H
 |