add SaveToJsonFile() function from SM4 betas.

This commit is contained in:
AJ Kelly
2012-07-01 12:24:39 -05:00
parent 7d6fffeb8c
commit 64e7b85a9e
2 changed files with 2523 additions and 2513 deletions
+6
View File
@@ -1049,6 +1049,12 @@ bool Song::SaveToSSCFile( RString sPath, bool bSavingCache )
return true; return true;
} }
bool Song::SaveToJsonFile( RString sPath)
{
LOG->Trace( "Song::SaveToJsonFile('%s')", sPath.c_str() );
return NotesWriterJson::WriteSong(sPath, *this, true);
}
bool Song::SaveToCacheFile() bool Song::SaveToCacheFile()
{ {
SONGINDEX->AddCacheIndex(m_sSongDir, GetHashForDirectory(m_sSongDir)); SONGINDEX->AddCacheIndex(m_sSongDir, GetHashForDirectory(m_sSongDir));
+4
View File
@@ -116,6 +116,10 @@ public:
bool SaveToSSCFile( RString sPath, bool bSavingCache ); bool SaveToSSCFile( RString sPath, bool bSavingCache );
/** @brief Save to the SSC and SM files no matter what. */ /** @brief Save to the SSC and SM files no matter what. */
void Save(); void Save();
/**
* @brief Save the current Song to a JSON file.
* @return its success or failure. */
bool SaveToJsonFile();
/** /**
* @brief Save the current Song to a cache file using the preferred format. * @brief Save the current Song to a cache file using the preferred format.
* @return its success or failure. */ * @return its success or failure. */