Remove the IntToString function, use std.

...this seriously didn't belong in Rage.
This commit is contained in:
Jason Felds
2013-05-04 11:22:10 -04:00
parent 07b9fb6da5
commit 490327cf55
4 changed files with 268 additions and 280 deletions
-7
View File
@@ -1758,13 +1758,6 @@ int StringToInt( const RString &sString )
return ret;
}
RString IntToString( const int &iNum )
{
stringstream ss;
ss << iNum;
return ss.str();
}
float StringToFloat( const RString &sString )
{
float ret = strtof( sString, nullptr );
-5
View File
@@ -410,11 +410,6 @@ void MakeLower( wchar_t *p, size_t iLen );
* @param sString the string to convert.
* @return the integer we are after. */
int StringToInt( const RString &sString );
/**
* @brief Have a standard way of converting integers to Strings.
* @param iNum the integer to convert.
* @return the string we are after. */
RString IntToString( const int &iNum );
float StringToFloat( const RString &sString );
RString FloatToString( const float &num );
bool StringToFloat( const RString &sString, float &fOut );
+1 -1
View File
@@ -98,7 +98,7 @@ struct MenuRowDef
{
for ( int i = low; i <= high; i++ )
{
choices.push_back(IntToString(i).c_str());
choices.push_back(std::to_string(i));
}
}
+19 -19
View File
@@ -121,8 +121,8 @@ void FakeSegment::DebugPrint() const
RString FakeSegment::ToString(int dec) const
{
RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetLength());
}
@@ -138,8 +138,8 @@ void FakeSegment::Scale( int start, int length, int newLength )
RString WarpSegment::ToString(int dec) const
{
RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetLength());
}
@@ -156,12 +156,12 @@ void WarpSegment::Scale( int start, int length, int newLength )
RString TickcountSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec) + "f=%i";
const RString str = "%.0" + std::to_string(dec) + "f=%i";
return ssprintf(str.c_str(), GetBeat(), GetTicks());
}
RString ComboSegment::ToString(int dec) const
{
RString str = "%.0" + IntToString(dec) + "f=%i";
RString str = "%.0" + std::to_string(dec) + "f=%i";
if (GetCombo() == GetMissCombo())
{
return ssprintf(str.c_str(), GetBeat(), GetCombo());
@@ -172,28 +172,28 @@ RString ComboSegment::ToString(int dec) const
RString LabelSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec) + "f=%s";
const RString str = "%.0" + std::to_string(dec) + "f=%s";
return ssprintf(str.c_str(), GetBeat(), GetLabel().c_str());
}
RString BPMSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
const RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetBPM());
}
RString TimeSignatureSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec) + "f=%i=%i";
const RString str = "%.0" + std::to_string(dec) + "f=%i=%i";
return ssprintf(str.c_str(), GetBeat(), GetNum(), GetDen());
}
RString SpeedSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f=%.0"
+ IntToString(dec) + "f=%u";
const RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f=%.0"
+ std::to_string(dec) + "f=%u";
return ssprintf(str.c_str(), GetBeat(), GetRatio(),
GetDelay(), GetUnit());
}
@@ -220,22 +220,22 @@ void SpeedSegment::Scale( int start, int oldLength, int newLength )
RString ScrollSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
const RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetRatio());
}
RString StopSegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
const RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetPause());
}
RString DelaySegment::ToString(int dec) const
{
const RString str = "%.0" + IntToString(dec)
+ "f=%.0" + IntToString(dec) + "f";
const RString str = "%.0" + std::to_string(dec)
+ "f=%.0" + std::to_string(dec) + "f";
return ssprintf(str.c_str(), GetBeat(), GetPause());
}