chxavnextline.h

来自「symbian 下的helix player源代码」· C头文件 代码 · 共 50 行

H
50
字号
/*============================================================================*
 *
 * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
 *
 *============================================================================*/
 
#ifndef _NEXT_LINE_H
#define _NEXT_LINE_H

#include "hxstring.h"

#include "chxavbuffer.h"
#include "chxbody.h"
#include "chxsmartptr.h"
#include "chxmakesmartptr.h"

class CHXAvNextLine : public CHXBody {
public:
    CHXAvNextLine(const CHXString& name="");
    ~CHXAvNextLine();

    bool Open();		// Open file
    void Close();		// Close file
    bool IsOpen() const;	// Return true if open
    bool Reset();		// If file rewindable seek to beginning
    bool GetLine(CHXString& line); // Get next line
    bool End() const;		// return true if at end of file

    int LineNum() const;        // Current line number

protected:
				// replacement for system fgets that
				// looks for \r in addtion to \n
    char* FGetS(CHXAvBuffer& buf, FILE* fp);

private:
    CHXString m_name;		// File name: if "" then use stdin
    FILE* m_pFile;		// Use stdio for now
    CHXAvBuffer m_buf;		// Buffer for reading lines
    int m_lineNum;               // Current line number
};

inline
int CHXAvNextLine::LineNum() const
{
    return m_lineNum;
}

#endif // _NEXT_LINE_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?