📄 levelparser.h
字号:
/*
* ==============================================================================
* Name : LevelParser.h
* Part of : RGA Game Example
* Interface :
* Description : parsing of the level data from text file
* Version : 1.0
*
* Copyright (c) 2007-2008 Nokia Corporation.
* This material, including documentation and any related
* computer programs, is protected by copyright controlled by
* Nokia Corporation.
* ==============================================================================
*/
#ifndef __LEVELPARSER_H__
#define __LEVELPARSER_H__
#include <e32base.h>
#include <f32file.h>
class CLevelParser : public CBase
{
public:
CLevelParser();
virtual ~CLevelParser();
/**
* Init
* @param aFilename level file to parse
* @return KErrNone or an error code
*/
TInt Init(const TDesC& aFilename);
/**
* FindNextTag
* @param aTag tag to find from file, starting from current location
* @return ETrue if tag was found and current position moved to tag data
*/
TBool FindNextTag(const TDesC8& aTag);
/**
* GetTagData
* get raw text from current tag
* @param aBuffer buffer that receives tag data
* @return KErrNone, KErrUnderflow, KErrNotFound
*/
TInt GetTagData(TDes8& aBuffer) const;
/**
* GetNextTagInt
* get next integer value from current tag
* @param aValue
* @return ETrue if value was found, EFalse otherwise
*/
TBool GetNextTagInt(TInt& aValue);
/**
* Position
* @return current file position
*/
TUint32 Position() const;
/**
* SetPosition
* @param aPosition new file position
*/
void SetPosition(TUint32 aPosition);
private:
TUint8* iFileBuffer;
TUint32 iFileBufferSize;
TUint32 iPosition;
TUint32 iDataPosStart;
TUint32 iDataPosEnd;
TUint32 iValuePos;
};
#endif /* __LEVELPARSER_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -