filelogger.h

来自「Active Object实现动画」· C头文件 代码 · 共 57 行

H
57
字号
/*
* ==============================================================================
*  Name     : CFileLogger
*  Part of  : AOExample
*  Created  : 6.5.2004 by Markus Pelkonen
*  Description:
*  Version  :
*  Copyright: Nokia
* ==============================================================================
*/

#ifndef FILELOGGER_H
#define FILELOGGER_H

#include <e32base.h>
#include <f32file.h>

_LIT( KDefaultLogFile, "c:\\FileLogger.txt" );
class CFileLogger : public CBase
    {
    public:
        /**
        * Factory method for construction. See ConstructL(const TDesC&) for
        * detailed documentation.
        */
        static CFileLogger* CFileLogger::NewL( const TDesC &logFileName = KDefaultLogFile );

        /**
         * Construct an instance of the MResultViewer that writes contents to
         * the file specified by logFileName parameter. The file is opened at
         * the construction time and kept open until object is destroyed.
         *
         * @param logFileName file name where contents are written.
         */
        void ConstructL( const TDesC &logFileName = KDefaultLogFile );

        /**
        * Destroys the object and closes the file opened at construction time.
        */
        virtual ~CFileLogger();

        /**
        * Flushes the internal buffer to the file and resets the iBuf;
        * @see MResultViewer::UpdateView().
        */
        virtual void Flush();

    public:
        TBuf<1024> iBuf;

    private:
        RFs        iFsSession;
        RFile      iFile;
    };

#endif

⌨️ 快捷键说明

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