|
/************************************************************************
*
* Description : CProjectLintAnalyser - class for analysing Visual C++
* projects (.vcproj or .dsp) using the PC-Lint code analysis
* tool.
*
* (c) Copyright 2004-2008 by Anna-Jayne Metcalfe (anna@riverblade.co.uk)
* and Beth Mackenzie (beth@riverblade.co.uk) / Riverblade Limited
*
* Licence Terms:
*
* This code may be freely reused, subject to the licence terms below.
* Please do let us know of any bugs you find or improvements you make,
* so that we can pass them on to the rest of the development community.
*
* This code is free software; you can redistribute it and/or
* modify it under the terms of the Code Project Open License (CPOL)
* version 1.0 (http://www.codeproject.com/info/cpol10.aspx).
*
* This code is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* Code Project Open Licence for further details.
*
************************************************************************
* $Archive: /Projects/Applications/LintProject/1.4/ProjectLintAnalyser.h $
* $Revision: 18 $
* $Date: 7/01/09 12:53 $
* $Author: Anna $
*
* $Nokeywords: $
************************************************************************/
/// \file
/// \brief CProjectLintAnalyser class declaration.
#pragma once
#include "FileLintAnalyser.h"
class CSolutionLintAnalyser;
class CProjectLintAnalyser
{
public:
CProjectLintAnalyser(void);
CProjectLintAnalyser( CSolutionLintAnalyser* pSolutionAnalyser,
const CString& sProjectFilePathName,
const CString& sSolutionFileResultFolder,
const CString& sResultsFileFolder,
const CString& sSolutionFileFolder, // [Alex McCarthy 21.10.2008]
const CString& sLintConfigFile,
const CString& sAdditionalProjectParams,
const CString& sAdditionalParams,
const CString& sConfiguration);
CProjectLintAnalyser( const CProjectLintAnalyser& src);
bool operator==(const CProjectLintAnalyser& src) const;
virtual ~CProjectLintAnalyser(void);
CProjectLintAnalyser& operator=(const CProjectLintAnalyser& src);
// Data Members
protected:
CString m_sLintFolder;
CString m_sProjectFilePathName;
CString m_sProjectFileFolder;
CString m_sSolutionFileFolder; // [Alex McCarthy 21.10.2008]
CString m_sPlatformName; // [Alex McCarthy 23.12.2008]
CString m_sLintConfigFile;
CString m_sAdditionalProjectParams;
CString m_sAdditionalParams;
CString m_sConfiguration;
CString m_sConfigurationString;
CString m_sIntermediateFilesFolder;
bool m_bShowHtml;
CString m_sSolutionFileResultFolder;
CString m_sProjectName;
CString m_sResultsFileFolder;
COleDateTime m_timeStarted;
int m_nWarningCount;
CString m_sResultsIndexFilePathName;
CString m_sElapsedTime;
CAtlArray<CString> m_arrayImplementationFilePathNames;
CAtlArray<CString> m_arrayConfigurations;
CAtlArray<CFileLintAnalyser>
m_arrayFileResults;
bool m_bAnalysed;
CSolutionLintAnalyser* m_pSolutionAnalyser; ///< Pointer to the containing solution analyser. Only needed for WriteIndexFile() callbacks.
// Virtual overrides
protected:
virtual bool PostWriteResultsFile(const CString& sResultsIndexFilePathName);
// Operations
public:
bool IsVSDotNetProject(void) const;
bool SetLintFolder(const CString& sFolder);
bool ShowHtml(bool bShowHtml);
//int GetFileName(void) const;
size_t GetImplementationFileCount(void) const
{ return m_arrayImplementationFilePathNames.GetCount(); }
size_t GetConfigurations(CAtlArray<CString>& rarrayConfigurations) const;
int GetWarningCount(void) const;
CString GetResultsIndexFilePathName(void) const;
CString GetResultsIndexFileName(void) const;
bool Analyse(void);
// Implementation
protected:
int ReadProjectFile(const CString& sProjectFilePathName,
const CString& sConfiguration,
CAtlArray<CString>& rarrayPathNames,
CString& rsConfigurationString,
CString& rsIntermediateFilesFolder);
bool LintFiles(const CAtlArray<CString>& arrayPathNames);
public:
bool WriteResultsIndexFile(void);
bool WriteXml( const CString& sPathName,
CString* psMsg = NULL);
bool WriteReport( const CString& sPathName,
const CString& sXslStyleSheetText,
CString* psMsg = NULL);
CString GenerateReportText( const CString& sXslStyleSheetText,
CString* psMsg = NULL) const;
CString GenerateReportText( const MSXML2::IXMLDOMDocumentPtr& ptrDOMDoc,
const MSXML2::IXMLDOMDocumentPtr& ptrXslStyleSheetDoc,
CString* psMsg = NULL) const;
HRESULT GenerateXml( const MSXML2::IXMLDOMDocumentPtr& ptrDOMDoc,
CString* psMsg = NULL) const;
HRESULT GenerateXml( const MSXML2::IXMLDOMDocumentPtr& ptrDOMDoc,
const MSXML2::IXMLDOMElementPtr& ptrParentElement,
CString* psMsg = NULL) const;
bool SetEnvironmentVariables(void);
bool ResetEnvironmentVariables(void);
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I haven't always written software for a living. When I graduated from Surrey University in 1989, it was with an Electronic Engineering degree, but unfortunately that never really gave me the opportunity to do anything particularly interesting (with the possible exception of designing
Darth Vader's Codpiece * for the UK Army in 1990).
* Also known as the Standard Army Bootswitch. But that's another story...
Since the opportunity arose to lead a software team developing C++ software for
Avionic Test Systems in 1996, I've not looked back. More recently I've been involved in the development of subsea acoustic navigation systems, digital TV broadcast systems, port security/tracking systems, and most recently software development tools with my own company,
Riverblade Ltd.
One of my personal specialities is IDE plug-in development.
ResOrg was my first attempt at a plug-in, but my day to day work is with
Visual Lint, an interactive code analysis tool environment with works within the Visual Studio and Eclipse IDEs or on build servers.
I love lots of things, but particularly music, photography and anything connected with history or engineering. I
despise ignorant, intolerant and obstructive people - and it shows...I can be a bolshy cow if you wind me up the wrong way...
I'm currently based 15 minutes walk from the beach in Bournemouth on the south coast of England. Since I moved here I've grown to love the place - even if it is full of grockles in Summer!
I'm a software developer and/or tester with Riverblade Ltd (www.riverblade.co.uk) developing our core product range including our Visual Lint integration product and Lint Project Professional.
I incorporate a number of technologies into a daily basis including Windows API, C++ (VS2008), Managed C++, CLI, Databases, Java, JNI, Eclipse Framework, CDT and of course Visual Studio Extensibility (VSIP VSX).
In my spare time I enjoy cooking (prepping ingredients from scratch!), running, cycling, swimming, reading, interested in experimental electronic music (such as ClockDVA), movies, volunteering my IT skills where I can.