Index: p/common/stl-util.cpp
===================================================================
--- /cpp/common/stl-util.cpp	(revision 839)
+++ 	(revision )
@@ -1,185 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#include "stl-util.h"
-#include <stdarg.h>
-#include <stdlib.h>
-#include "nonstd_stdio.h"
-#include "Convert.h"
-#include "nonstd.h"
-#include "log.h"
-#include <assert.h>
-#ifdef USE_VIRTFILE
-#include <common/virtfile/virtfile.h>
-#endif
-
-
-string ssprintf_va(const char* format, va_list ap)
-{
-	string s; //clang crashed when this declaration was in s=buf
-	int size = 256;
-	char* buf;
-	va_list ap_copy; // "va_list ap" can only by used once by printf-type functions as they advance the current argument pointer (crashed on linux x86_64)
-	// (does not apply to SString::sprintf, it does not have the va_list variant)
-
-	//almost like SString::sprintf, but there is no common code to share because SString can use its directWrite to avoid double allocating/copying
-#ifdef USE_VSCPRINTF
-	va_copy(ap_copy, ap);
-	size = _vscprintf(format, ap_copy) + 1; //+1 for terminating null character
-	va_end(ap_copy);
-#endif
-
-	while (1)
-	{
-		buf = (char*)malloc(size);
-		assert(buf != NULL);
-		va_copy(ap_copy, ap);
-		int n = vsnprintf(buf, size, format, ap_copy);
-		va_end(ap_copy);
-		if (n > -1 && n < size)
-		{
-			s = buf;
-			free(buf);
-			return s;
-		}
-#ifdef VSNPRINTF_RETURNS_REQUIRED_SIZE
-		if (n > -1)    /* glibc 2.1 */
-			size = n+1; /* precisely what is needed */
-		else           /* glibc 2.0 */
-#endif
-			size *= 2;  /* twice the old size */
-		free(buf);
-	}
-}
-
-char* strmove(char *a, char *b) //strcpy that works well for overlapping strings ("Source and destination overlap")
-{
-	if (a == NULL || b == NULL)
-		return NULL;
-	memmove(a, b, strlen(b) + 1);
-	return a;
-}
-
-string ssprintf(const char* format, ...)
-{
-	va_list ap;
-	va_start(ap, format);
-	string ret = ssprintf_va(format, ap); //is it too wasteful? copying the string again... unless the compiler can handle it better
-	va_end(ap);
-	return ret;
-}
-
-bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file)
-{
-	bool ok = false;
-#ifdef USE_VIRTFILE
-//	if (!isAbsolutePath(filename))
-	{
-		VirtFILE *f=Vfopen(filename,FOPEN_READ_BINARY);
-		if (f)
-		{
-			int size=f->getSize();
-			data.resize(size);
-			int przeczytane = f->Vread(&data[0], size, 1);
-			ok = przeczytane == 1;
-			delete f;
-		}
-	}
-//	else
-#endif
-	{
-		MFILE *f = mfopen(filename, FOPEN_READ_BINARY);
-		if (f)
-		{
-			int size = getFileSize(f);
-			data.resize(size);
-			int przeczytane = mfread(&data[0], size, 1, f);
-			mfclose(f);
-			ok = przeczytane == 1;
-		}
-	}
-	if (warn_on_missing_file && !ok)
-		logPrintf("stl-util", "readCompleteFile", LOG_WARN, "Couldn't open file '%s'", filename);
-	return ok;
-}
-
-bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file)
-{
-	vector<char> data;
-	if (readCompleteFile(filename, data, warn_on_missing_file))
-	{
-		out = string(&data[0], data.size());
-		return true;
-	}
-	return false;
-}
-
-bool writeCompleteFile(const char* filename, const string& text, bool warn_on_fail)
-{
-#ifdef USE_VIRTFILE
-	VirtFILE *f = Vfopen(filename, FOPEN_WRITE_BINARY);
-	bool ok = f != NULL;
-	if (f)
-	{
-		int zapisane = f->Vwrite(text.c_str(), text.length(), 1);
-		delete f;
-		ok &= zapisane == 1;
-	}
-#else
-	MFILE *f = mfopen(filename, FOPEN_WRITE_BINARY);
-	bool ok = f != NULL;
-	if (f)
-	{
-		int zapisane = mfwrite(text.c_str(), text.length(), 1, f);
-		mfclose(f);
-		ok &= zapisane == 1;
-	}
-#endif
-	if (warn_on_fail && !ok)
-		logPrintf("stl-util", "writeCompleteFile", LOG_WARN, "Couldn't write file '%s'", filename);
-	return ok;
-}
-
-bool writeCompleteFile(const char* filename, vector<char>& data, bool warn_on_fail)
-{
-	string s(&data[0], data.size());
-	return writeCompleteFile(filename, s, warn_on_fail);
-}
-
-
-
-string stripExt(const string& filename)
-{
-	size_t dot = filename.rfind('.');
-	if (dot == string::npos) return filename;
-	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
-	if ((sep == string::npos) || (sep < dot))
-		return filename.substr(0, dot);
-	return filename;
-}
-
-string stripFileDir(const string& filename)
-{
-	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
-	if (sep == string::npos) return filename;
-	return filename.substr(sep+1);
-}
-
-string getFileExt(const string& filename)
-{
-	size_t dot = filename.rfind('.');
-	if (dot == string::npos) return string("");
-	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
-	if ((sep == string::npos) || (sep < dot))
-		return filename.substr(dot);
-	return string("");
-}
-
-string getFileDir(const string& filename)
-{
-	size_t slash = filename.rfind(PATH_SEPARATOR_CHAR);
-	if (slash == string::npos) return string("");
-	return filename.substr(0, slash);
-}
-
Index: p/common/stl-util.h
===================================================================
--- /cpp/common/stl-util.h	(revision 839)
+++ 	(revision )
@@ -1,70 +1,0 @@
-// This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
-// See LICENSE.txt for details.
-
-#ifndef _STL_UTIL_H_
-#define _STL_UTIL_H_
-
-#include "nonstd_stl.h"
-#include <stdarg.h>
-
-template<typename T, std::size_t N> void push_back(vector<T>& v, T(&d)[N])
-{
-	for (unsigned int i = 0; i < N; i++)
-		v.push_back(d[i]);
-}
-
-template<typename T> void erase(vector<T>& v, const T& e)
-{
-	typename vector<T>::iterator it = std::find(v.begin(), v.end(), e);
-	if (it != v.end())
-		v.erase(it);
-}
-
-template<typename T> void deleteVectorElements(vector<T*>& v)
-{
-	for (typename vector<T*>::iterator it = v.begin(); it != v.end(); it++)
-		delete *it;
-	v.clear();
-}
-
-template<typename T> int findIndex(vector<T>& v, const T& e)
-{
-	typename vector<T>::iterator it = find(v.begin(), v.end(), e);
-	if (it != v.end())
-		return &*it - &v.front();
-	return -1;
-}
-
-
-char* strmove(char *a, char *b); //strcpy that works well for overlapping strings ("Source and destination overlap")
-
-string ssprintf(const char* format, ...);
-string ssprintf_va(const char* format, va_list ap);
-
-string stripExt(const string& filename); // strip extension from filename
-string getFileExt(const string& filename); // get extension (starting with ".") from filename
-string getFileDir(const string& filename); // get path component excluding filename ("" if no dir in file)
-string stripFileDir(const string& filename); // strip path component from filename
-
-
-bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file = true);
-bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file = true);
-bool writeCompleteFile(const char* filename, const std::string& text, bool warn_on_fail = true);
-bool writeCompleteFile(const char* filename, vector<char>& data, bool warn_on_fail = true);
-
-template<class T> class DeletingVector  // deletes the elements (pointers) in destructor
-{
-public:
-	std::vector<T*> vector;
-	~DeletingVector()
-	{
-		for (int i = vector.size() - 1; i >= 0; i--)
-			delete vector[i];
-	}
-	T* operator[](int i) { return vector[i]; }
-	int size() { return vector.size(); }
-	void push_back(T* x) { vector.push_back(x); }
-};
-
-#endif
Index: /cpp/common/util-file.cpp
===================================================================
--- /cpp/common/util-file.cpp	(revision 840)
+++ /cpp/common/util-file.cpp	(revision 840)
@@ -0,0 +1,88 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "util-file.h"
+#include "nonstd_stdio.h"
+#include "nonstd.h"
+#include "log.h"
+#ifdef USE_VIRTFILE
+#include <common/virtfile/virtfile.h>
+#endif
+
+bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file)
+{
+	bool ok = false;
+#ifdef USE_VIRTFILE
+//	if (!isAbsolutePath(filename))
+	{
+		VirtFILE *f=Vfopen(filename,FOPEN_READ_BINARY);
+		if (f)
+		{
+			int size=f->getSize();
+			data.resize(size);
+			int przeczytane = f->Vread(&data[0], size, 1);
+			ok = przeczytane == 1;
+			delete f;
+		}
+	}
+//	else
+#endif
+	{
+		MFILE *f = mfopen(filename, FOPEN_READ_BINARY);
+		if (f)
+		{
+			int size = getFileSize(f);
+			data.resize(size);
+			int przeczytane = mfread(&data[0], size, 1, f);
+			mfclose(f);
+			ok = przeczytane == 1;
+		}
+	}
+	if (warn_on_missing_file && !ok)
+		logPrintf("stl-util", "readCompleteFile", LOG_WARN, "Couldn't open file '%s'", filename);
+	return ok;
+}
+
+bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file)
+{
+	vector<char> data;
+	if (readCompleteFile(filename, data, warn_on_missing_file))
+	{
+		out = string(&data[0], data.size());
+		return true;
+	}
+	return false;
+}
+
+bool writeCompleteFile(const char* filename, const string& text, bool warn_on_fail)
+{
+#ifdef USE_VIRTFILE
+	VirtFILE *f = Vfopen(filename, FOPEN_WRITE_BINARY);
+	bool ok = f != NULL;
+	if (f)
+	{
+		int zapisane = f->Vwrite(text.c_str(), text.length(), 1);
+		delete f;
+		ok &= zapisane == 1;
+	}
+#else
+	MFILE *f = mfopen(filename, FOPEN_WRITE_BINARY);
+	bool ok = f != NULL;
+	if (f)
+	{
+		int zapisane = mfwrite(text.c_str(), text.length(), 1, f);
+		mfclose(f);
+		ok &= zapisane == 1;
+	}
+#endif
+	if (warn_on_fail && !ok)
+		logPrintf("stl-util", "writeCompleteFile", LOG_WARN, "Couldn't write file '%s'", filename);
+	return ok;
+}
+
+bool writeCompleteFile(const char* filename, vector<char>& data, bool warn_on_fail)
+{
+	string s(&data[0], data.size());
+	return writeCompleteFile(filename, s, warn_on_fail);
+}
Index: /cpp/common/util-file.h
===================================================================
--- /cpp/common/util-file.h	(revision 840)
+++ /cpp/common/util-file.h	(revision 840)
@@ -0,0 +1,15 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _UTIL_FILES_H_
+#define _UTIL_FILES_H_
+
+#include "nonstd_stl.h"
+
+bool readCompleteFile(const char* filename, vector<char>& data, bool warn_on_missing_file = true);
+bool readCompleteFile(const char* filename, string& out, bool warn_on_missing_file = true);
+bool writeCompleteFile(const char* filename, const std::string& text, bool warn_on_fail = true);
+bool writeCompleteFile(const char* filename, vector<char>& data, bool warn_on_fail = true);
+
+#endif
Index: /cpp/common/util-stl.h
===================================================================
--- /cpp/common/util-stl.h	(revision 840)
+++ /cpp/common/util-stl.h	(revision 840)
@@ -0,0 +1,52 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _UTIL_STL_H_
+#define _UTIL_STL_H_
+
+#include "nonstd_stl.h"
+
+template<typename T, std::size_t N> void push_back(vector<T>& v, T(&d)[N])
+{
+	for (unsigned int i = 0; i < N; i++)
+		v.push_back(d[i]);
+}
+
+template<typename T> void erase(vector<T>& v, const T& e)
+{
+	typename vector<T>::iterator it = std::find(v.begin(), v.end(), e);
+	if (it != v.end())
+		v.erase(it);
+}
+
+template<typename T> void deleteVectorElements(vector<T*>& v)
+{
+	for (typename vector<T*>::iterator it = v.begin(); it != v.end(); it++)
+		delete *it;
+	v.clear();
+}
+
+template<typename T> int findIndex(vector<T>& v, const T& e)
+{
+	typename vector<T>::iterator it = find(v.begin(), v.end(), e);
+	if (it != v.end())
+		return &*it - &v.front();
+	return -1;
+}
+
+template<class T> class DeletingVector  // deletes the elements (pointers) in destructor
+{
+public:
+	std::vector<T*> vector;
+	~DeletingVector()
+	{
+		for (int i = vector.size() - 1; i >= 0; i--)
+			delete vector[i];
+	}
+	T* operator[](int i) { return vector[i]; }
+	int size() { return vector.size(); }
+	void push_back(T* x) { vector.push_back(x); }
+};
+
+#endif
Index: /cpp/common/util-string.cpp
===================================================================
--- /cpp/common/util-string.cpp	(revision 840)
+++ /cpp/common/util-string.cpp	(revision 840)
@@ -0,0 +1,101 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2018  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#include "util-file.h"
+#include <stdarg.h>
+#include "nonstd_stdio.h"
+#include "nonstd.h"
+#include <assert.h>
+#ifdef USE_VIRTFILE
+#include <common/virtfile/virtfile.h>
+#endif
+
+string ssprintf_va(const char* format, va_list ap)
+{
+	string s; //clang crashed when this declaration was in s=buf
+	int size = 256;
+	char* buf;
+	va_list ap_copy; // "va_list ap" can only by used once by printf-type functions as they advance the current argument pointer (crashed on linux x86_64)
+	// (does not apply to SString::sprintf, it does not have the va_list variant)
+
+	//almost like SString::sprintf, but there is no common code to share because SString can use its directWrite to avoid double allocating/copying
+#ifdef USE_VSCPRINTF
+	va_copy(ap_copy, ap);
+	size = _vscprintf(format, ap_copy) + 1; //+1 for terminating null character
+	va_end(ap_copy);
+#endif
+
+	while (1)
+	{
+		buf = (char*)malloc(size);
+		assert(buf != NULL);
+		va_copy(ap_copy, ap);
+		int n = vsnprintf(buf, size, format, ap_copy);
+		va_end(ap_copy);
+		if (n > -1 && n < size)
+		{
+			s = buf;
+			free(buf);
+			return s;
+		}
+#ifdef VSNPRINTF_RETURNS_REQUIRED_SIZE
+		if (n > -1)    /* glibc 2.1 */
+			size = n+1; /* precisely what is needed */
+		else           /* glibc 2.0 */
+#endif
+			size *= 2;  /* twice the old size */
+		free(buf);
+	}
+}
+
+char* strmove(char *a, char *b) //strcpy that works well for overlapping strings ("Source and destination overlap")
+{
+	if (a == NULL || b == NULL)
+		return NULL;
+	memmove(a, b, strlen(b) + 1);
+	return a;
+}
+
+string ssprintf(const char* format, ...)
+{
+	va_list ap;
+	va_start(ap, format);
+	string ret = ssprintf_va(format, ap); //is it too wasteful? copying the string again... unless the compiler can handle it better
+	va_end(ap);
+	return ret;
+}
+
+string stripExt(const string& filename)
+{
+	size_t dot = filename.rfind('.');
+	if (dot == string::npos) return filename;
+	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
+	if ((sep == string::npos) || (sep < dot))
+		return filename.substr(0, dot);
+	return filename;
+}
+
+string stripFileDir(const string& filename)
+{
+	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
+	if (sep == string::npos) return filename;
+	return filename.substr(sep+1);
+}
+
+string getFileExt(const string& filename)
+{
+	size_t dot = filename.rfind('.');
+	if (dot == string::npos) return string("");
+	size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
+	if ((sep == string::npos) || (sep < dot))
+		return filename.substr(dot);
+	return string("");
+}
+
+string getFileDir(const string& filename)
+{
+	size_t slash = filename.rfind(PATH_SEPARATOR_CHAR);
+	if (slash == string::npos) return string("");
+	return filename.substr(0, slash);
+}
Index: /cpp/common/util-string.h
===================================================================
--- /cpp/common/util-string.h	(revision 840)
+++ /cpp/common/util-string.h	(revision 840)
@@ -0,0 +1,21 @@
+// This file is a part of Framsticks SDK.  http://www.framsticks.com/
+// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// See LICENSE.txt for details.
+
+#ifndef _UTIL_STRINGS_H_
+#define _UTIL_STRINGS_H_
+
+#include "nonstd_stl.h"
+#include <stdarg.h>
+
+char* strmove(char *a, char *b); //strcpy that works well for overlapping strings ("Source and destination overlap")
+
+string ssprintf(const char* format, ...);
+string ssprintf_va(const char* format, va_list ap);
+
+string stripExt(const string& filename); // strip extension from filename
+string getFileExt(const string& filename); // get extension (starting with ".") from filename
+string getFileDir(const string& filename); // get path component excluding filename ("" if no dir in file)
+string stripFileDir(const string& filename); // strip path component from filename
+
+#endif
