⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simpleparsers.h

📁 一个统计文件大小和程序信息的插件程序(vc或vc.net下使用)
💻 H
字号:
/***************************************************************************/
/* NOTE:                                                                   */
/* This document is copyright (c) by Oz Solomonovich, and is bound by the  */
/* MIT open source license (www.opensource.org/licenses/mit-license.html). */
/* See License.txt for more information.                                   */
/***************************************************************************/

#ifndef __SIMPLEPARSERS_H
#define __SIMPLEPARSERS_H

#include "FileParser.h"

class CSimpleCommentParser : public IFileParser
{
public:
    CSimpleCommentParser(LPCTSTR pszCommentPrefix);

    virtual void ParseFile(ifstream& ifs, CFileInfo& info);

protected:
    CString m_sCommentPrefix;
};


class CPlainTextParser : public CSimpleCommentParser
{
public:

    CPlainTextParser() : CSimpleCommentParser("") {}

    LPCTSTR GetDefaultExtensions() const
    {
        return _T("BAT/TXT/RGS");
    }

    virtual LPCTSTR GetParserCfgCode() const 
    {
        return _T("TXT");
    }

    virtual int GetParserNameResourceID() const
    {
        return IDS_PARSERNAME_TXT;
    }
};

class CINIParser : public CSimpleCommentParser
{
public:

    CINIParser() : CSimpleCommentParser(";") {}

    LPCTSTR GetDefaultExtensions() const
    {
        return _T("INI/DEF/HHP/HPJ");
    }

    virtual LPCTSTR GetParserCfgCode() const 
    {
        return _T("INI");
    }

    virtual int GetParserNameResourceID() const
    {
        return IDS_PARSERNAME_INI;
    }
};

class CMakeFileParser : public CSimpleCommentParser
{
public:

    CMakeFileParser() : CSimpleCommentParser("#") {}

    LPCTSTR GetDefaultExtensions() const
    {
        return _T("MAK/MAKE/PROPERTIES");
    }

    virtual LPCTSTR GetParserCfgCode() const 
    {
        return _T("MAK");
    }

    virtual int GetParserNameResourceID() const
    {
        return IDS_PARSERNAME_MAK;
    }
};


#endif // __SIMPLEPARSERS_H

⌨️ 快捷键说明

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