#ifndef SUPPORTFUNCTIONS_H
#define SUPPORTFUNCTIONS_H

#include "Mathematics.h"
#include <string>
#include <fstream>

using namespace std;


string intToString( int value );
string floatToString( float value );

long stringToLongLong( const string& str);
long stringToLong( const string& str);
string longToString( long value );
string longlongToString( long long value );

int stringToInt( const string& str);
float stringToFloat( const string& str);
string intToString( int value, int minimalDigitCount );

bool getNthStringFromFile( const string& filePath, int n, string &dstText );


template< typename T> T& clamp( const T &from, const T &to , T &dstSrcVal)
{
	dstSrcVal = max( min( to, dstSrcVal), from);
	return dstSrcVal;
}

template< typename T> T getClamped( const T &from, const T &to , const T &srcVal)
{
	return max( min( to, srcVal), from);
}

///auxiliary function
template< typename T> T convertNanoAngleToAngle( T microAngle )
{
	return (T) (microAngle / 1000000000.0);
}

#endif