implement CourseWriterCRS::GetEditFile, CourseWriterCRS::Write(RageFileBasic)
This commit is contained in:
@@ -5,12 +5,11 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
#include "song.h"
|
#include "song.h"
|
||||||
|
#include "RageFileDriverMemory.h"
|
||||||
|
|
||||||
|
|
||||||
bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bSavingCache )
|
bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bSavingCache )
|
||||||
{
|
{
|
||||||
ASSERT( !course.m_bIsAutogen );
|
|
||||||
|
|
||||||
RageFile f;
|
RageFile f;
|
||||||
if( !f.Open( sPath, RageFile::WRITE ) )
|
if( !f.Open( sPath, RageFile::WRITE ) )
|
||||||
{
|
{
|
||||||
@@ -18,6 +17,20 @@ bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return CourseWriterCRS::Write( course, f, bSavingCache );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CourseWriterCRS::GetEditFile( const Course *pCourse, CString &sOut )
|
||||||
|
{
|
||||||
|
RageFileObjMem mem;
|
||||||
|
CourseWriterCRS::Write( *pCourse, mem, true );
|
||||||
|
sOut = mem.GetString();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CourseWriterCRS::Write( const Course &course, RageFileBasic &f, bool bSavingCache )
|
||||||
|
{
|
||||||
|
ASSERT( !course.m_bIsAutogen );
|
||||||
|
|
||||||
f.PutLine( ssprintf("#COURSE:%s;", course.m_sMainTitle.c_str()) );
|
f.PutLine( ssprintf("#COURSE:%s;", course.m_sMainTitle.c_str()) );
|
||||||
if( course.m_sMainTitleTranslit != "" )
|
if( course.m_sMainTitleTranslit != "" )
|
||||||
f.PutLine( ssprintf("#COURSETRANSLIT:%s;", course.m_sMainTitleTranslit.c_str()) );
|
f.PutLine( ssprintf("#COURSETRANSLIT:%s;", course.m_sMainTitleTranslit.c_str()) );
|
||||||
@@ -137,11 +150,6 @@ bool CourseWriterCRS::Write( const Course &course, const CString &sPath, bool bS
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CourseWriterCRS::GetEditFile( const Course *pCourse, CString &sOut )
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
* (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||||
|
|||||||
@@ -4,10 +4,12 @@
|
|||||||
#define CourseWriterCRS_H
|
#define CourseWriterCRS_H
|
||||||
|
|
||||||
class Course;
|
class Course;
|
||||||
|
class RageFileBasic;
|
||||||
|
|
||||||
class CourseWriterCRS
|
class CourseWriterCRS
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static bool Write( const Course &course, RageFileBasic &f, bool bSavingCache );
|
||||||
static bool Write( const Course &course, const CString &sPath, bool bSavingCache );
|
static bool Write( const Course &course, const CString &sPath, bool bSavingCache );
|
||||||
static void GetEditFile( const Course *pCourse, CString &sOut );
|
static void GetEditFile( const Course *pCourse, CString &sOut );
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user