Files
itgmania212121/stepmania/src/MsdFile.h
T

46 lines
1.2 KiB
C++
Raw Normal View History

#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
2003-01-14 22:44:30 +00:00
Glenn Maynard
2002-07-23 01:41:40 +00:00
-----------------------------------------------------------------------------
*/
class MsdFile
{
2003-01-14 22:44:30 +00:00
public:
/* #param:param:param:param; <- one whole value */
struct value_t
{
vector<CString> params;
CString operator[](unsigned i) const { if(i >= params.size()) return ""; return params[i]; }
};
virtual ~MsdFile() { }
//returns true if successful, false otherwise
bool ReadFile( CString sFilePath );
unsigned GetNumValues() const { return values.size(); }
unsigned GetNumParams(unsigned val) const { if(val >= GetNumValues()) return 0; return values[val].params.size(); }
const value_t &GetValue(unsigned val) const { ASSERT(val < GetNumValues()); return values[val]; }
CString GetParam(unsigned val, unsigned par) const;
private:
void ReadBuf( char *buf, int len );
void AddParam( char *buf, int len );
void AddValue();
2003-01-14 22:44:30 +00:00
vector<value_t> values;
2002-07-23 01:41:40 +00:00
};
#endif