2002-11-16 08:07:38 +00:00
|
|
|
#ifndef MSDFILE_H
|
|
|
|
|
#define MSDFILE_H
|
2002-07-23 01:41:40 +00:00
|
|
|
/*
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
Class: MsdFile
|
|
|
|
|
|
|
|
|
|
Desc: Wrapper for reading and writing an .sm, .dwi, .or msd file.
|
|
|
|
|
|
|
|
|
|
Copyright (c) 2001-2002 by the person(s) listed below. All rights reserved.
|
|
|
|
|
Chris Danford
|
|
|
|
|
-----------------------------------------------------------------------------
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2002-10-31 03:25:35 +00:00
|
|
|
const unsigned MAX_VALUES = 200;
|
|
|
|
|
const unsigned MAX_PARAMS_PER_VALUE = 10;
|
2002-07-23 01:41:40 +00:00
|
|
|
|
|
|
|
|
class MsdFile
|
|
|
|
|
{
|
2002-12-14 03:47:05 +00:00
|
|
|
void ReadBuf( char *buf, int len );
|
|
|
|
|
void AddParam( char *buf, int len );
|
|
|
|
|
void AddValue();
|
|
|
|
|
|
2003-01-14 22:10:04 +00:00
|
|
|
unsigned m_iNumValues; // tells how many values are valid
|
|
|
|
|
|
2002-07-23 01:41:40 +00:00
|
|
|
public:
|
|
|
|
|
MsdFile();
|
|
|
|
|
|
|
|
|
|
//default destructor
|
|
|
|
|
virtual ~MsdFile();
|
|
|
|
|
|
|
|
|
|
//reads ini file specified using MsdFile::SetPath()
|
|
|
|
|
//returns true if successful, false otherwise
|
|
|
|
|
bool ReadFile( CString sFilePath );
|
|
|
|
|
|
2002-09-15 07:03:32 +00:00
|
|
|
CString m_sParams[MAX_VALUES][MAX_PARAMS_PER_VALUE];
|
2002-07-23 01:41:40 +00:00
|
|
|
|
2003-01-14 22:10:04 +00:00
|
|
|
/* #param:param:param:param; <- one whole value */
|
2002-10-31 03:25:35 +00:00
|
|
|
unsigned m_iNumParams[MAX_VALUES]; // tells how many params this value has
|
2003-01-14 22:10:04 +00:00
|
|
|
|
|
|
|
|
unsigned GetNumValues() const { return m_iNumValues; }
|
2002-07-23 01:41:40 +00:00
|
|
|
};
|
2002-11-16 08:07:38 +00:00
|
|
|
|
|
|
|
|
#endif
|