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

📄 docmaker.cpp

📁 这是一个能够自动生成文档的程序
💻 CPP
字号:
// DocMaker.cpp: implementation of the CDocMaker class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"

#include "DocMaker.h"
#include "Symbols.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

BEGIN_TEST_DUMP(CDocMaker)
END_TEST_DUMP()


CDocMaker::CDocMaker()
{

}

CDocMaker::~CDocMaker()
{

}

BOOL CDocMaker::IsCppFile(LPCTSTR iPathName)
{
	CString ext;
	CString pathName(iPathName);
	int pos = pathName.ReverseFind('.');
	if(pos != -1)
		ext = pathName.Mid(pos+1);

	ext.MakeLower();
    TEST_TRACE(ext);
	if(ext == 'c' || ext == 'h' || ext == "cpp" || ext == "cxx")
		return TRUE;

	return FALSE;
}


BOOL CDocMaker::ParseFiles(LPCTSTR iDir, LPCTSTR iDocDir/*=NULL*/)
{
	CString dir = iDir;
	if(dir.IsEmpty())
		return FALSE;

	if(dir.Right(1) != "\\")
		dir += "\\";
	    
	CFileFind finder;

	//在当前目录查找。
	BOOL found = finder.FindFile(dir + "*.*");
	while(found)
    {
        found = finder.FindNextFile();
		if(finder.IsDirectory())
		{ 
			if(!finder.IsDots())
                return ParseFiles(finder.GetFilePath()); 
		}
		else
		{
			CString pathName = finder.GetFilePath();
            if(IsCppFile(pathName))
			{
				TEST_TRACE(pathName);
				mParser.ParseFile(pathName);
			}
		}
    }

	return TRUE;
}

⌨️ 快捷键说明

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