Index: cpp/common/Convert.cpp
===================================================================
--- cpp/common/Convert.cpp	(revision 197)
+++ cpp/common/Convert.cpp	(revision 247)
@@ -8,11 +8,11 @@
 
 #if defined __ANDROID__ || defined __BORLANDC__
- #include <ctype.h> //toupper, tolower
+#include <ctype.h> //toupper, tolower
 #endif
 
 #ifdef SHP
- #include <cstdlib>
+#include <cstdlib>
 #else
- #include <stdlib.h>
+#include <stdlib.h>
 #endif
 
@@ -20,29 +20,27 @@
 
 
-int Convert::toInt(string s) {return atoi(s.c_str());}
-float Convert::toFloat(string s) {return (float)atof(s.c_str());}
-#ifndef __BORLANDC__ //the borland compiler compiles this file in GUI and CLI, but not in the theater app. Somehow it cannot find ::tolower and ::toupper; maybe this is because of various #defines in <cctype>, but why only in the theater app??
-string Convert::toLowerCase(string s) {std::transform(s.begin(), s.end(), s.begin(), ::tolower);  return s;}
-string Convert::toUpperCase(string s) {std::transform(s.begin(), s.end(), s.begin(), ::toupper);  return s;}
-#endif
-char Convert::toLowerCase(char c) {return (char)tolower(c);}
-char Convert::toUpperCase(char c) {return (char)toupper(c);}
+int Convert::toInt(string s) { return atoi(s.c_str()); }
+float Convert::toFloat(string s) { return (float)atof(s.c_str()); }
+string Convert::toLowerCase(string s) { std::transform(s.begin(), s.end(), s.begin(), ::tolower);  return s; }
+string Convert::toUpperCase(string s) { std::transform(s.begin(), s.end(), s.begin(), ::toupper);  return s; }
+char Convert::toLowerCase(char c) { return (char)tolower(c); }
+char Convert::toUpperCase(char c) { return (char)toupper(c); }
 
-template<class T> const char* printf_format_for(const T& value) {return "unknown type";}
-template<> const char* printf_format_for(const unsigned int& value) {return "%u";}
-template<> const char* printf_format_for(const int& value) {return "%d";}
-template<> const char* printf_format_for(const short& value) {return "%d";}
-template<> const char* printf_format_for(const float& value) {return "%g";}
-template<> const char* printf_format_for(const double& value) {return "%g";}
+template<class T> const char* printf_format_for(const T& value) { return "unknown type"; }
+template<> const char* printf_format_for(const unsigned int& value) { return "%u"; }
+template<> const char* printf_format_for(const int& value) { return "%d"; }
+template<> const char* printf_format_for(const short& value) { return "%d"; }
+template<> const char* printf_format_for(const float& value) { return "%g"; }
+template<> const char* printf_format_for(const double& value) { return "%g"; }
 
 template<class T> string Convert::_toString(const T& value)
 {
-char buf[30];
-sprintf(buf,printf_format_for(value),value);
-return string(buf);
-/*
-#ifndef MULTITHREADED
+	char buf[30];
+	sprintf(buf, printf_format_for(value), value);
+	return string(buf);
+	/*
+	#ifndef MULTITHREADED
 	static
-#endif
+	#endif
 	std::ostringstream oss; //pod VS tworzenie go trwa dlugo nawet w wersji release (szczegolnie jak np konwertuje sie cos setki tysiecy razy)
 	//dlatego robimy go raz (static) i potem tylko czyscimy
@@ -51,14 +49,22 @@
 	oss.clear(); //clear error flag
 	oss.str(""); //set empty string
-  oss << value;
-  return oss.str();
-*/
+	oss << value;
+	return oss.str();
+	*/
 }
 
-string Convert::toString(unsigned int v) {return _toString(v);}
-string Convert::toString(int v) {return _toString(v);}
-string Convert::toString(short v) {return _toString(v);}
-string Convert::toString(float v) {return _toString(v);}
-string Convert::toString(double v) {return _toString(v);}
+string Convert::toString(unsigned int v) { return _toString(v); }
+string Convert::toString(int v) { return _toString(v); }
+string Convert::toString(short v) { return _toString(v); }
+string Convert::toString(float v) { return _toString(v); }
+string Convert::toString(double v) { return _toString(v); }
+
+uint32_t Convert::hexToInt(const string& col)
+{
+	uint32_t value;
+	std::istringstream iss(col);
+	iss >> std::hex >> value;
+	return value;
+}
 
 #ifdef MULTITHREADED
@@ -69,5 +75,5 @@
 //z mutexa gdy drugi dalej by go inicjalizowal
 #include "threads.h"
-static pthread_mutex_t fix_unsafe_mutex=PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t fix_unsafe_mutex = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
@@ -76,20 +82,20 @@
 #ifndef MULTITHREADED
 
-return *::localtime(&timep);
+	return *::localtime(&timep);
 
 #else
 
-struct tm ret;
+	struct tm ret;
 
 #if defined LINUX // || android?
-return *::localtime_r(&timep,&ret);
+	return *::localtime_r(&timep,&ret);
 #elif defined _WIN32 && !defined __BORLANDC__ // and not bada?
-::localtime_s(&ret,&timep);
-return ret;
+	::localtime_s(&ret, &timep);
+	return ret;
 #else //borland?
-pthread_mutex_lock(&fix_unsafe_mutex);
-ret=*::localtime(&timep);
-pthread_mutex_unlock(&fix_unsafe_mutex);
-return ret;
+	pthread_mutex_lock(&fix_unsafe_mutex);
+	ret=*::localtime(&timep);
+	pthread_mutex_unlock(&fix_unsafe_mutex);
+	return ret;
 #endif
 
@@ -99,26 +105,25 @@
 string Convert::asctime(const struct tm &tm)
 {
-char *ret;
+	char *ret;
 #ifndef MULTITHREADED
 
-ret=::asctime(&tm);
+	ret=::asctime(&tm);
 
 #else //MULTITHREADED
 
-char buf[26];
+	char buf[26];
 #if defined LINUX // || android?
-ret=::asctime_r(&tm,buf);
+	ret=::asctime_r(&tm,buf);
 #elif defined _WIN32 && !defined __BORLANDC__ // and not bada?
-asctime_s(buf,sizeof(buf),&tm);
-ret=buf;
+	asctime_s(buf, sizeof(buf), &tm);
+	ret = buf;
 #else //borland?
-pthread_mutex_lock(&fix_unsafe_mutex);
-strcpy(buf,::asctime(&tm));
-ret=buf;
-pthread_mutex_unlock(&fix_unsafe_mutex);
+	pthread_mutex_lock(&fix_unsafe_mutex);
+	strcpy(buf,::asctime(&tm));
+	ret=buf;
+	pthread_mutex_unlock(&fix_unsafe_mutex);
 #endif
 #endif
 
-return string(ret,24); //24 znaki z pominieciem ostatniego \n
+	return string(ret, 24); //24 znaki z pominieciem ostatniego \n
 }
-
