use untemplated trim*
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include "IniFile.h"
|
||||
#include "RageUtil.h"
|
||||
#include <fstream>
|
||||
using namespace std;
|
||||
|
||||
@@ -56,8 +57,8 @@ bool IniFile::ReadFile()
|
||||
if (line[0] == '[' && line[line.GetLength()-1] == ']') //if a section heading
|
||||
{
|
||||
keyname = line;
|
||||
keyname.TrimLeft('[');
|
||||
keyname.TrimRight(']');
|
||||
TrimLeft(keyname, "[");
|
||||
TrimRight(keyname, "]");
|
||||
}
|
||||
else //if a value
|
||||
{
|
||||
|
||||
@@ -77,8 +77,8 @@ void NoteData::LoadFromSMNoteDataString( CString sSMNoteData )
|
||||
for( unsigned m=0; m<asMeasures.size(); m++ ) // foreach measure
|
||||
{
|
||||
CString &sMeasureString = asMeasures[m];
|
||||
sMeasureString.TrimLeft();
|
||||
sMeasureString.TrimRight();
|
||||
TrimLeft(sMeasureString);
|
||||
TrimRight(sMeasureString);
|
||||
|
||||
CStringArray asMeasureLines;
|
||||
split( sMeasureString, "\n", asMeasureLines, true ); // ignore empty is important
|
||||
@@ -92,8 +92,8 @@ void NoteData::LoadFromSMNoteDataString( CString sSMNoteData )
|
||||
for( unsigned l=0; l<asMeasureLines.size(); l++ )
|
||||
{
|
||||
CString &sMeasureLine = asMeasureLines[l];
|
||||
sMeasureLine.TrimLeft();
|
||||
sMeasureLine.TrimRight();
|
||||
TrimLeft(sMeasureLine);
|
||||
TrimRight(sMeasureLine);
|
||||
|
||||
const float fPercentIntoMeasure = l/(float)asMeasureLines.size();
|
||||
const float fBeat = (m + fPercentIntoMeasure) * BEATS_PER_MEASURE;
|
||||
|
||||
@@ -45,7 +45,7 @@ bool KSFLoader::LoadFromKSFFile( const CString &sPath, Notes &out )
|
||||
NoteData notedata; // read it into here
|
||||
|
||||
CStringArray asRows;
|
||||
iStep.TrimLeft();
|
||||
TrimLeft(iStep);
|
||||
split( iStep, "\n", asRows, true );
|
||||
|
||||
int iHoldStartRow[13];
|
||||
|
||||
@@ -17,12 +17,12 @@ void SMLoader::LoadFromSMTokens(
|
||||
Notes &out
|
||||
)
|
||||
{
|
||||
sNotesType.TrimLeft();
|
||||
sNotesType.TrimRight();
|
||||
sDescription.TrimLeft();
|
||||
sDescription.TrimRight();
|
||||
sDifficulty.TrimLeft();
|
||||
sDifficulty.TrimRight();
|
||||
TrimLeft(sNotesType);
|
||||
TrimRight(sNotesType);
|
||||
TrimLeft(sDescription);
|
||||
TrimRight(sDescription);
|
||||
TrimLeft(sDifficulty);
|
||||
TrimRight(sDifficulty);
|
||||
|
||||
|
||||
// LOG->Trace( "Notes::LoadFromSMTokens()" );
|
||||
|
||||
@@ -136,8 +136,8 @@ void PlayerOptions::FromString( CString sOptions )
|
||||
for( unsigned i=0; i<asBits.size(); i++ )
|
||||
{
|
||||
CString& sBit = asBits[i];
|
||||
sBit.TrimLeft();
|
||||
sBit.TrimRight();
|
||||
TrimLeft(sBit);
|
||||
TrimRight(sBit);
|
||||
|
||||
if( sBit == "0.5x" ) m_fArrowScrollSpeed = 0.5f;
|
||||
else if( sBit == "0.75x" ) m_fArrowScrollSpeed = 0.75f;
|
||||
|
||||
@@ -366,9 +366,9 @@ bool Song::LoadFromSongDir( CString sDir )
|
||||
|
||||
void Song::TidyUpData()
|
||||
{
|
||||
m_sMainTitle.TrimRight();
|
||||
TrimRight(m_sMainTitle);
|
||||
if( m_sMainTitle == "" ) m_sMainTitle = "Untitled song";
|
||||
m_sSubTitle.TrimRight();
|
||||
TrimRight(m_sSubTitle);
|
||||
if( m_sArtist == "" ) m_sArtist = "Unknown artist";
|
||||
if( m_BPMSegments.empty() )
|
||||
throw RageException( "No #BPM specified in '%s%s.'", m_sSongDir.GetString(), m_sSongFileName.GetString() );
|
||||
|
||||
@@ -113,7 +113,7 @@ void SongManager::AddGroup( CString sDir, CString sGroupDirName )
|
||||
void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
||||
{
|
||||
// trim off the trailing slash if any
|
||||
sDir.TrimRight( "/\\" );
|
||||
TrimRight( sDir, "/\\" );
|
||||
|
||||
// Find all group directories in "Songs" folder
|
||||
CStringArray arrayGroupDirs;
|
||||
@@ -176,7 +176,7 @@ void SongManager::LoadStepManiaSongDir( CString sDir, void(*callback)() )
|
||||
void SongManager::LoadDWISongDir( CString DWIHome )
|
||||
{
|
||||
// trim off the trailing slash if any
|
||||
DWIHome.TrimRight( "/\\" );
|
||||
TrimRight( DWIHome, "/\\" );
|
||||
|
||||
// this has to be fixed, DWI doesn't put files
|
||||
// in it's DWI folder. It puts them in Songs/<MIX>/<SONGNAME>
|
||||
|
||||
@@ -70,8 +70,8 @@ void SongOptions::FromString( CString sOptions )
|
||||
for( unsigned i=0; i<asBits.size(); i++ )
|
||||
{
|
||||
CString& sBit = asBits[i];
|
||||
sBit.TrimLeft();
|
||||
sBit.TrimRight();
|
||||
TrimLeft(sBit);
|
||||
TrimRight(sBit);
|
||||
|
||||
if( sBit == "norecover" ) m_DrainType = DRAIN_NO_RECOVER;
|
||||
else if( sBit == "suddendeath" ) m_DrainType = DRAIN_SUDDEN_DEATH;
|
||||
|
||||
Reference in New Issue
Block a user