Index: cpp/frams/util/extvalue.cpp
===================================================================
--- cpp/frams/util/extvalue.cpp	(revision 970)
+++ cpp/frams/util/extvalue.cpp	(revision 973)
@@ -326,5 +326,5 @@
 		{
 			SString tmp = getString();
-			if (tmp.len() > 30) tmp = tmp.substr(0, 30) + "...";
+			if (tmp.length() > 30) tmp = tmp.substr(0, 30) + "...";
 			if (type == TString) tmp = SString("\"") + tmp + SString("\"");
 			logPrintf("ExtValue", "getObjectTarget", LOG_WARN, "%s object expected, %s found", classname, tmp.c_str());
@@ -614,5 +614,5 @@
 			return;
 		case TDouble:
-			setDouble(double(getInt())*src.getDouble());
+			setDouble(double(getInt()) * src.getDouble());
 			return;
 		default:;
@@ -790,5 +790,5 @@
 	//            ^-cur     ^-next
 	//            ^^^^^^^^^^___sub
-	const char* begin = fmt.c_str(), *end = begin + fmt.len(), *curr = begin;
+	const char* begin = fmt.c_str(), *end = begin + fmt.length(), *curr = begin;
 	int type = 0;
 
@@ -1401,5 +1401,5 @@
 	err->message = args[0].getString();
 	if (err->message.startsWith(TO_STRING_PREFIX.c_str()))
-		err->message = err->message.substr(TO_STRING_PREFIX.len());
+		err->message = err->message.substr(TO_STRING_PREFIX.length());
 	*ret = makeDynamicObject(err);
 }
Index: cpp/frams/util/sstring-simple.cpp
===================================================================
--- cpp/frams/util/sstring-simple.cpp	(revision 970)
+++ cpp/frams/util/sstring-simple.cpp	(revision 973)
@@ -8,5 +8,5 @@
 void SString::initEmpty()
 {
-	txt = NULL; used = 0; size = 0;
+	txt = NULL; used = 0; allocated = 0;
 }
 
@@ -18,5 +18,5 @@
 SString::~SString()
 {
-	resize(0);
+	reallocate(0);
 }
 
@@ -36,6 +36,6 @@
 SString::SString(SString&& from)
 {
-	txt = from.txt; size = from.size; used = from.used;
-	from.txt = NULL; from.size = 0; from.used = 0;
+	txt = from.txt; allocated = from.allocated; used = from.used;
+	from.txt = NULL; from.allocated = 0; from.used = 0;
 }
 
@@ -46,20 +46,20 @@
 }
 
-void SString::resize(int newsize)
-{
-	if (newsize == size) return;
+void SString::reallocate(int newsize)
+{
+	if (newsize == allocated) return;
 	txt = (char*)realloc(txt, newsize);
-	size = newsize;
-}
-
-void SString::ensureSize(int needed)
-{
-	if (size > needed) return;
-	resize((size > 0) ? (needed + needed / 2 + 1) : (needed + 1));
+	allocated = newsize;
+}
+
+void SString::ensureAllocated(int needed)
+{
+	if (allocated > needed) return;
+	reallocate((allocated > 0) ? (needed + needed / 2 + 1) : (needed + 1));
 }
 
 char *SString::directWrite(int ensuresize)
 {
-	ensureSize(ensuresize);
+	ensureAllocated(ensuresize);
 	appending = used;
 	return txt;
@@ -68,5 +68,5 @@
 char *SString::directAppend(int maxappend)
 {
-	ensureSize(used + maxappend);
+	ensureAllocated(used + maxappend);
 	appending = used;
 	return txt + appending;
@@ -78,5 +78,5 @@
 	else txt[newlength] = 0;
 	used = newlength;
-	assert(used < size);
+	assert(used < allocated);
 }
 
@@ -86,5 +86,5 @@
 	else txt[appending + newappend] = 0;
 	used = appending + newappend;
-	assert(used < size);
+	assert(used < allocated);
 }
 
@@ -102,5 +102,5 @@
 {
 	if (!n) return;
-	ensureSize(used + n);
+	ensureAllocated(used + n);
 	memmove(txt + used, t, n);
 	used += n;
@@ -110,5 +110,5 @@
 void SString::operator+=(const SString&s)
 {
-	append(s.c_str(), s.len());
+	append(s.c_str(), s.length());
 }
 
@@ -116,5 +116,5 @@
 {
 	SString ret;
-	ret.reserve(len() + s.len());
+	ret.reserve(length() + s.length());
 	ret = *this;
 	ret += s;
@@ -130,5 +130,5 @@
 	if (chlen)
 	{
-		ensureSize(chlen);
+		ensureAllocated(chlen);
 		memmove(txt, ch, chlen);
 		txt[chlen] = 0;
@@ -153,16 +153,16 @@
 {
 	if (&s == this) return;
-	copyFrom(s.c_str(), s.len());
+	copyFrom(s.c_str(), s.length());
 }
 
 ///////////////////////////////////////
 
-SString SString::substr(int begin, int length) const
-{
-	if (begin < 0) { length += begin; begin = 0; }
-	if (length >= (len() - begin)) length = len() - begin;
-	if (length <= 0) return SString();
-	if (length == len()) return *this;
-	return SString((*this)(begin), length);
+SString SString::substr(int begin, int numchars) const
+{
+	if (begin < 0) { numchars += begin; begin = 0; }
+	if (numchars >= (length() - begin)) numchars = length() - begin;
+	if (numchars <= 0) return SString();
+	if (numchars == length()) return *this;
+	return SString((*this)(begin), numchars);
 }
 
@@ -172,5 +172,5 @@
 {
 	if (this == &s) return true;
-	if (len() != s.len()) return false;
+	if (length() != s.length()) return false;
 	return strcmp(getPtr(), s.getPtr()) == 0;
 }
@@ -198,9 +198,9 @@
 bool SString::getNextToken(int& pos, SString &token, char separator) const
 {
-	if (pos >= len()) { token = 0; return false; }
+	if (pos >= length()) { token = 0; return false; }
 	int p1 = pos, p2;
 	const char *t1 = getPtr() + pos;
 	const char *t2 = strchr(t1, separator);
-	if (t2) pos = (p2 = (t2 - getPtr())) + 1; else p2 = pos = len();
+	if (t2) pos = (p2 = (t2 - getPtr())) + 1; else p2 = pos = length();
 	strncpy(token.directWrite(p2 - p1), t1, p2 - p1);
 	token.endWrite(p2 - p1);
@@ -254,5 +254,5 @@
 		char* p = ret.directWrite(size);
 		assert(p != NULL);
-		size = ret.directMaxLen() + 1;
+		size = ret.capacity() + 1;
 		/* Try to print in the allocated space. */
 		va_start(ap, format);
Index: cpp/frams/util/sstring-simple.h
===================================================================
--- cpp/frams/util/sstring-simple.h	(revision 970)
+++ cpp/frams/util/sstring-simple.h	(revision 973)
@@ -14,5 +14,5 @@
 private:
 	char *txt;      ///< string buffer or NULL for empty string
-	int size;       ///< allocated memory (including \0)
+	int allocated;       ///< allocated memory (including \0)
 	int used;	///< string length
 	int appending;  ///< append mode, changes can occur after character # 'appending'
@@ -20,6 +20,6 @@
 	void initEmpty();
 	void copyFrom(SString &from); ///< copy from SString
-	void resize(int newsize);
-	void ensureSize(int needed);
+	void reallocate(int newsize);
+	void ensureAllocated(int needed);
 	const char* getPtr() const { return txt ? txt : ""; }
 
@@ -34,15 +34,16 @@
 
 	void copyFrom(const char* ch, int chlen = -1); ///< copy string, length of -1 == unknown
-	
-	void* operator new(size_t s, void* mem){ return mem; }
+
+	void* operator new(size_t s, void* mem) { return mem; }
 #ifdef _MSC_VER
-		void operator delete(void* mem, void* t) {}
+	void operator delete(void* mem, void* t) {}
 #endif
-	void* operator new(size_t s){ return malloc(sizeof(SString)); }
+	void* operator new(size_t s) { return malloc(sizeof(SString)); }
 	void operator delete(void* mem) { free(mem); }
 
-	int len() const { return used; } ///< get string length
+	int length() const { return used; } ///< get string length
+	int size() const { return length(); } ///< get string length
 	void shrink(); ///< free unnecessary buffer
-	void reserve(int needed) { ensureSize(needed); } ///< like in std::string
+	void reserve(int cap) { ensureAllocated(cap + 1); } ///< like in std::string
 
 	/// after this call, you can modify sstring directly.
@@ -87,6 +88,5 @@
 	void endAppend(int appendlength = -1);
 
-	void memoryHint(int howbig) { ensureSize(howbig); }
-	int directMaxLen() { return size - 1; } ///< when called after directWrite: max number of characters allowed (can be more than requested)
+	int capacity() { return (allocated > 0) ? (allocated - 1) : allocated; } ///< std::string.capacity()
 
 	/// find a character in SString.
Index: cpp/frams/util/sstring.cpp
===================================================================
--- cpp/frams/util/sstring.cpp	(revision 970)
+++ cpp/frams/util/sstring.cpp	(revision 973)
@@ -163,9 +163,4 @@
 }
 
-void SString::memoryHint(int howbig)
-{
-	detachCopy(howbig);
-}
-
 void SString::detachEmpty(int ensuresize)
 {
@@ -201,5 +196,5 @@
 char *SString::directWrite(int ensuresize)
 {
-	if (ensuresize < 0) ensuresize = len();
+	if (ensuresize < 0) ensuresize = length();
 	REF_LOCK;
 	detachCopy(ensuresize);
@@ -259,5 +254,5 @@
 void SString::operator+=(const SString&s)
 {
-	append(s.c_str(), s.len());
+	append(s.c_str(), s.length());
 }
 
@@ -298,11 +293,11 @@
 ///////////////////////////////////////
 
-SString SString::substr(int begin, int length) const
-{
-	if (begin < 0) { length += begin; begin = 0; }
-	if (length >= (len() - begin)) length = len() - begin;
-	if (length <= 0) return SString();
-	if (length == len()) return *this;
-	return SString((*this)(begin), length);
+SString SString::substr(int begin, int numchars) const
+{
+	if (begin < 0) { numchars += begin; begin = 0; }
+	if (numchars >= (length() - begin)) numchars = length() - begin;
+	if (numchars <= 0) return SString();
+	if (numchars == length()) return *this;
+	return SString((*this)(begin), numchars);
 }
 
@@ -337,9 +332,9 @@
 bool SString::getNextToken(int& pos, SString &token, char separator) const
 {
-	if (pos >= len()) { token = 0; return false; }
+	if (pos >= length()) { token = 0; return false; }
 	int p1 = pos, p2;
 	const char *t1 = buf->txt + pos;
 	const char *t2 = strchr(t1, separator);
-	if (t2) pos = (p2 = (t2 - buf->txt)) + 1; else p2 = pos = len();
+	if (t2) pos = (p2 = (t2 - buf->txt)) + 1; else p2 = pos = length();
 	strncpy(token.directWrite(p2 - p1), t1, p2 - p1);
 	token.endWrite(p2 - p1);
@@ -401,5 +396,5 @@
 		char* p = ret.directWrite(size);
 		assert(p != NULL);
-		size = ret.directMaxLen() + 1;
+		size = ret.capacity() + 1;
 		/* Try to print in the allocated space. */
 		va_start(ap, format);
Index: cpp/frams/util/sstring.h
===================================================================
--- cpp/frams/util/sstring.h	(revision 970)
+++ cpp/frams/util/sstring.h	(revision 973)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -85,7 +85,8 @@
 	void operator delete(void* mem) { free(mem); }
 
-	int len() const { return buf->used; } ///< get string length
+	int size() const { return buf->used; } ///< get string length
+	int length() const { return buf->used; } ///< get string length
 	void shrink(); ///< free unnecessary buffer
-	void reserve(int needed) { ensureSize(needed); } ///< like in std::string
+	void reserve(int needed) { detachCopy(needed); } ///< like in std::string
 
 	/// after this call, you can modify sstring directly.
@@ -129,9 +130,5 @@
 	/// t.endAppend(bytecount);</CODE>
 	void endAppend(int appendlength = -1);
-	/// argument is the amount of memory, that will be probably used
-	/// by this string instance. string can use this value
-	/// to optimize memory allocation (bigger chunks will be allocated).
-	void memoryHint(int howbig);
-	int directMaxLen() { return buf->size; } ///< when called after directWrite: max number of characters allowed (can be more than requested)
+	int capacity() { return buf->size; } ///< std::string.capacity()
 
 	/// find a character in SString.
Index: cpp/frams/util/sstringutils.cpp
===================================================================
--- cpp/frams/util/sstringutils.cpp	(revision 970)
+++ cpp/frams/util/sstringutils.cpp	(revision 973)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2020  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -79,5 +79,5 @@
 		else
 		{
-			if (tmp.len() == 0) return 0; // nothing was changed!
+			if (tmp.length() == 0) return 0; // nothing was changed!
 			tmp += x;
 			target = tmp;
@@ -112,5 +112,5 @@
 		else
 		{
-			if (tmp.len() == 0) return 0; // nothing was changed!
+			if (tmp.length() == 0) return 0; // nothing was changed!
 			tmp += x;
 			target = tmp;
@@ -139,5 +139,5 @@
 	bool changed = 0;
 	SString tmp;
-	tmp.memoryHint(target.len());
+	tmp.reserve(target.length());
 	while (*x)
 	{
@@ -160,6 +160,6 @@
 {
 	SString out;
-	if (in.len() > maxlen)
-		out = in.substr(0, maxlen / 2) + "..." + in.substr(in.len() - maxlen + maxlen / 2);
+	if (in.length() > maxlen)
+		out = in.substr(0, maxlen / 2) + "..." + in.substr(in.length() - maxlen + maxlen / 2);
 	else
 	{
@@ -169,5 +169,5 @@
 	out = before + out + after;
 	if (show_length)
-		out += SString::sprintf(" (length %d)", in.len());
+		out += SString::sprintf(" (length %d)", in.length());
 	return out;
 }
@@ -208,5 +208,5 @@
 		else
 		{
-			if (tmp.len() == 0) return 0; // nothing was changed!
+			if (tmp.length() == 0) return 0; // nothing was changed!
 			tmp += x;
 			target = tmp;
@@ -223,7 +223,7 @@
 	{
 		n = strchr(t + pos, ',');
-		if ((!strncmp(t + pos, name.c_str(), name.len())) && (t[pos + name.len()] == '='))
-		{
-			if (n) end = n - t; else end = txt.len();
+		if ((!strncmp(t + pos, name.c_str(), name.length())) && (t[pos + name.length()] == '='))
+		{
+			if (n) end = n - t; else end = txt.length();
 			return pos;
 		}
@@ -238,5 +238,5 @@
 	p = strFindField(txt, name, e);
 	if (p < 0) return SString();
-	p += name.len() + 1;
+	p += name.length() + 1;
 	return SString(txt.substr(p, e - p));
 }
@@ -248,29 +248,29 @@
 	if (p < 0)
 	{
-		if (!value.len()) return;
-		char *t = txt.directAppend(1 + name.len() + value.len());
+		if (!value.length()) return;
+		char *t = txt.directAppend(1 + name.length() + value.length());
 		char *b = t;
-		if (txt.len()) *(t++) = ',';
-		strcpy(t, name.c_str()); t += name.len();
+		if (txt.length()) *(t++) = ',';
+		strcpy(t, name.c_str()); t += name.length();
 		*(t++) = '=';
-		strcpy(t, value.c_str()); t += value.len();
+		strcpy(t, value.c_str()); t += value.length();
 		txt.endAppend(t - b);
 	}
 	else
 	{
-		if (!value.len())
-		{
-			if (p > 0) p--; else if (e < txt.len()) e++;
+		if (!value.length())
+		{
+			if (p > 0) p--; else if (e < txt.length()) e++;
 			char *t = txt.directWrite(0);
-			memmove(t + p, t + e, txt.len() - e);
-			txt.endWrite(txt.len() + value.len() - (e - p));
-		}
-		else
-		{
-			p += name.len() + 1;
-			char *t = txt.directWrite(txt.len() + value.len() - (e - p));
-			memmove(t + p + value.len(), t + e, txt.len() - e);
-			memmove(t + p, value.c_str(), value.len());
-			txt.endWrite(txt.len() + value.len() - (e - p));
+			memmove(t + p, t + e, txt.length() - e);
+			txt.endWrite(txt.length() + value.length() - (e - p));
+		}
+		else
+		{
+			p += name.length() + 1;
+			char *t = txt.directWrite(txt.length() + value.length() - (e - p));
+			memmove(t + p + value.length(), t + e, txt.length() - e);
+			memmove(t + p, value.c_str(), value.length());
+			txt.endWrite(txt.length() + value.length() - (e - p));
 		}
 	}
@@ -280,8 +280,8 @@
 {
 	const unsigned char*b = (const unsigned char*)s.c_str();
-	const unsigned char*e = b + s.len();
+	const unsigned char*e = b + s.length();
 	while ((b < e) && (*b <= ' ')) b++;
 	while ((b < e) && (e[-1] <= ' ')) e--;
-	if ((e - b) == s.len()) return s;
+	if ((e - b) == s.length()) return s;
 	SString newstring;
 	char* t = newstring.directWrite(e - b);
@@ -291,10 +291,10 @@
 }
 
-SString concatPath(const SString& in1,const SString& in2)
-{
-	SString out=in1;
-	if (out.len()>0 && out[out.len()-1]!=PATH_SEPARATOR_CHAR)
-		out+=PATH_SEPARATOR_CHAR;
-	out+=in2;
+SString concatPath(const SString& in1, const SString& in2)
+{
+	SString out = in1;
+	if (out.length() > 0 && out[out.length() - 1] != PATH_SEPARATOR_CHAR)
+		out += PATH_SEPARATOR_CHAR;
+	out += in2;
 	return out;
 }
@@ -318,6 +318,6 @@
 bool matchWildcard(const SString& word, const SString& pattern)
 {
-	if (pattern.len() == 0)
-		return word.len() == 0;
+	if (pattern.length() == 0)
+		return word.length() == 0;
 	int aster = pattern.indexOf('*');
 	if (aster >= 0)
@@ -325,9 +325,9 @@
 		SString before = pattern.substr(0, aster);
 		SString after = pattern.substr(aster + 1);
-		if (!word.len()) return false;
-		if (before.len()) if (!word.startsWith(before.c_str())) return false;
-		if (after.len())
-			if ((word.len() < after.len())
-				|| (strcmp(after.c_str(), word.c_str() + word.len() - after.len())))
+		if (!word.length()) return false;
+		if (before.length()) if (!word.startsWith(before.c_str())) return false;
+		if (after.length())
+			if ((word.length() < after.length())
+				|| (strcmp(after.c_str(), word.c_str() + word.length() - after.length())))
 				return false;
 		return true;
@@ -339,6 +339,6 @@
 bool matchWildcardList(const SString& word, const SString& patterns)
 {
-	if (patterns.len() == 0)
-		return word.len() == 0;
+	if (patterns.length() == 0)
+		return word.length() == 0;
 	int pos = 0;
 	SString pattern;
Index: cpp/frams/util/sstringutils.h
===================================================================
--- cpp/frams/util/sstringutils.h	(revision 970)
+++ cpp/frams/util/sstringutils.h	(revision 973)
@@ -40,5 +40,5 @@
 	int i, next = 0;
 	bool first = true;
-	if (!separator.len()) { result.push_back(text); return; }
+	if (!separator.length()) { result.push_back(text); return; }
 	while (1)
 	{
@@ -46,5 +46,5 @@
 		if (i < 0)
 		{
-			if ((next <= text.len()) || first)
+			if ((next <= text.length()) || first)
 				result.push_back(text.substr(next));
 			return;
@@ -55,5 +55,5 @@
 			first = false;
 		}
-		next = i + separator.len();
+		next = i + separator.length();
 	}
 }
