MsdFile::ReadFromString

This commit is contained in:
Glenn Maynard
2005-02-19 07:45:12 +00:00
parent 65b82c3e53
commit d9da6cc9fc
2 changed files with 11 additions and 0 deletions
+9
View File
@@ -149,6 +149,15 @@ bool MsdFile::ReadFile( CString sNewPath )
return true;
}
void MsdFile::ReadFromString( const CString &sString )
{
/* Be careful. ReadBuf modifies the buffer given to it. */
char *pCopy = new char[sString.size()];
memcpy( pCopy, sString.data(), sString.size() );
ReadBuf( pCopy, sString.size() );
delete [] pCopy;
}
CString MsdFile::GetParam(unsigned val, unsigned par) const
{
if(val >= GetNumValues()) return "";
+2
View File
@@ -18,6 +18,8 @@ public:
// Returns true if successful, false otherwise.
bool ReadFile( CString sFilePath );
void ReadFromString( const CString &sString );
CString GetError() const { return error; }
unsigned GetNumValues() const { return values.size(); }