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

📄 inffile.h

📁 PW芯片方案Flash ROM烧写程序
💻 H
字号:
//---------------------------------------------------------------------------
// Pixelworks Inc. Company Confidential Strictly Private
//
// $Archive: /SwTools/FlashUpgrader/InfFile.h $
// $Revision: 1.1.1.1 $
// $Author: KevinM $
// $Date: 2003/09/29 18:19:04 $
//
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Copyright 1997 (c) Pixelworks Inc.
//
// Pixelworks owns the sole copyright to this software. Under international 
// copyright laws you (1) may not make a copy of this software except for 
// the purposes of maintaining a single archive copy, (2) may not derive
// works herefrom, (3) may not distribute this work to others. These rights 
// are provided for information clarification, other restrictions of rights 
// may apply as well.
//
// This is an unpublished work.
// --------------------------------------------------------------------------
// >>>>>>>>>>>>>>>>>>>>>>>>>>>> WARRANTEE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
// --------------------------------------------------------------------------
// Pixelworks Inc. MAKES NO WARRANTY OF ANY KIND WITH REGARD TO THE USE OF
// THIS SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
// THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
// PURPOSE.
// --------------------------------------------------------------------------

#ifndef __INFFILE_H__
#define __INFFILE_H__

#include <afxtempl.h>

#define INF_FILE_KEY_FIELD      0

typedef struct
{
    int     nSection;
    int     nLine;
} LINECONTEXT, *PLINECONTEXT;

struct LineItem
{
    int         nSourceLine;
    CString     strText;
};

typedef CArray<LineItem, LineItem&> LINEARRAY;

class CInfFile
{
public:
    CInfFile();
    ~CInfFile();

    BOOL OpenInfFile(LPCSTR lpszFilepath);

    BOOL FindFirstLine(PLINECONTEXT pContext, LPCSTR lpszSection, LPCSTR lpszKey = NULL);
    BOOL FindNextSection(PLINECONTEXT pContext, CString& ref_strName);
    BOOL FindNextLine(PLINECONTEXT pContext);
    BOOL FindNextMatchLine(PLINECONTEXT pContext, LPCSTR lpszKey);

    BOOL GetLineText(PLINECONTEXT pContext, CString& ref_strText);
    BOOL GetLineText(LPCSTR lpszSection, LPCSTR lpszKey, CString& ref_strText);

    BOOL GetStringField(PLINECONTEXT, int nFieldIndex, CString& ref_strText);
    BOOL GetIntField(PLINECONTEXT pContext, int nFieldIndex, int& ref_nValue);

    BOOL GetSourceLineNum(PLINECONTEXT pContext, int& ref_nSrcLine);

private:
    LINEARRAY           m_LineArray;

    void AddLine(int nSrcLine, LPCSTR lpszText);

    BOOL GetRawLineText(int nLine, CString& ref_strLine);
    BOOL ExtractSectionName(CString strLine, CString& ref_strName);
    BOOL FindSectionStartLine(LPCSTR lpszSection, int& ref_nLine);
};

#endif

⌨️ 快捷键说明

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