📄 msvc_objectmodel.cpp
字号:
/************************************************************************ Copyright (C) 2000-2005 Trolltech AS. All rights reserved.**** This file is part of the Qtopia Environment.** ** This program is free software; you can redistribute it and/or modify it** under the terms of the GNU General Public License as published by the** Free Software Foundation; either version 2 of the License, or (at your** option) any later version.** ** A copy of the GNU GPL license version 2 is included in this package as ** LICENSE.GPL.**** This program 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 GNU General Public License for more details.**** In addition, as a special exception Trolltech gives permission to link** the code of this program with Qtopia applications copyrighted, developed** and distributed by Trolltech under the terms of the Qtopia Personal Use** License Agreement. You must comply with the GNU General Public License** in all respects for all of the code used other than the applications** licensed under the Qtopia Personal Use License Agreement. If you modify** this file, you may extend this exception to your version of the file,** but you are not obligated to do so. If you do not wish to do so, delete** this exception statement from your version.** ** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "msvc_objectmodel.h"#include "msvc_vcproj.h"#include <qtextstream.h>#include <qstringlist.h>#include <quuid.h>#if defined(Q_OS_WIN32)#include <objbase.h>#ifndef GUID_DEFINED#define GUID_DEFINEDtypedef struct _GUID{ ulong Data1; ushort Data2; ushort Data3; uchar Data4[8];} GUID;#endif#endif// XML Tags ---------------------------------------------------------const char* _xmlInit = "<?xml version=\"1.0\" encoding = \"Windows-1252\"?>";const char* _begConfiguration = "\n\t\t<Configuration";const char* _begConfigurations = "\n\t<Configurations>";const char* _begFile = "\n\t\t\t<File";const char* _begFileConfiguration = "\n\t\t\t\t<FileConfiguration";const char* _begFiles = "\n\t<Files>";const char* _begFilter = "\n\t\t<Filter";const char* _begGlobals = "\n\t<Globals>";const char* _begPlatform = "\n\t\t<Platform";const char* _begPlatforms = "\n\t<Platforms>";const char* _begTool3 = "\n\t\t\t<Tool";const char* _begTool5 = "\n\t\t\t\t\t<Tool";const char* _begVisualStudioProject = "\n<VisualStudioProject";const char* _endConfiguration = "\n\t\t</Configuration>";const char* _endConfigurations = "\n\t</Configurations>";const char* _endFile = "\n\t\t\t</File>";const char* _endFileConfiguration = "\n\t\t\t\t</FileConfiguration>";const char* _endFiles = "\n\t</Files>";const char* _endFilter = "\n\t\t</Filter>";const char* _endGlobals = "\n\t</Globals>";const char* _endPlatforms = "\n\t</Platforms>";const char* _endVisualStudioProject = "\n</VisualStudioProject>";// XML Properties ---------------------------------------------------const char* _AddModuleNamesToAssembly = "\n\t\t\t\tAddModuleNamesToAssembly=\"";const char* _AdditionalDependencies4 = "\n\t\t\t\tAdditionalDependencies=\"";const char* _AdditionalDependencies6 = "\n\t\t\t\t\t\tAdditionalDependencies=\"";const char* _AdditionalIncludeDirectories = "\n\t\t\t\tAdditionalIncludeDirectories=\"";const char* _AdditionalLibraryDirectories = "\n\t\t\t\tAdditionalLibraryDirectories=\"";const char* _AdditionalOptions = "\n\t\t\t\tAdditionalOptions=\"";const char* _AdditionalUsingDirectories = "\n\t\t\t\tAdditionalUsingDirectories=\"";const char* _AssemblerListingLocation = "\n\t\t\t\tAssemblerListingLocation=\"";const char* _AssemblerOutput = "\n\t\t\t\tAssemblerOutput=\"";const char* _ATLMinimizesCRunTimeLibraryUsage = "\n\t\t\tATLMinimizesCRunTimeLibraryUsage=\"";const char* _BaseAddress = "\n\t\t\t\tBaseAddress=\"";const char* _BasicRuntimeChecks = "\n\t\t\t\tBasicRuntimeChecks=\"";const char* _BrowseInformation = "\n\t\t\t\tBrowseInformation=\"";const char* _BrowseInformationFile = "\n\t\t\t\tBrowseInformationFile=\"";const char* _BufferSecurityCheck = "\n\t\t\t\tBufferSecurityCheck=\"";const char* _BuildBrowserInformation = "\n\t\t\tBuildBrowserInformation=\"";const char* _CPreprocessOptions = "\n\t\t\t\tCPreprocessOptions=\"";const char* _CallingConvention = "\n\t\t\t\tCallingConvention=\"";const char* _CharacterSet = "\n\t\t\tCharacterSet=\"";const char* _CommandLine4 = "\n\t\t\t\tCommandLine=\"";const char* _CommandLine6 = "\n\t\t\t\t\t\tCommandLine=\"";const char* _CompileAs = "\n\t\t\t\tCompileAs=\"";const char* _CompileAsManaged = "\n\t\t\t\tCompileAsManaged=\"";const char* _CompileOnly = "\n\t\t\t\tCompileOnly=\"";const char* _ConfigurationType = "\n\t\t\tConfigurationType=\"";const char* _Culture = "\n\t\t\t\tCulture=\"";const char* _DLLDataFileName = "\n\t\t\t\tDLLDataFileName=\"";const char* _DebugInformationFormat = "\n\t\t\t\tDebugInformationFormat=\"";const char* _DefaultCharIsUnsigned = "\n\t\t\t\tDefaultCharIsUnsigned=\"";const char* _DefaultCharType = "\n\t\t\t\tDefaultCharType=\"";const char* _DelayLoadDLLs = "\n\t\t\t\tDelayLoadDLLs=\"";const char* _DeleteExtensionsOnClean = "\n\t\t\tDeleteExtensionsOnClean=\"";const char* _Description4 = "\n\t\t\t\tDescription=\"";const char* _Description6 = "\n\t\t\t\t\t\tDescription=\"";const char* _Detect64BitPortabilityProblems = "\n\t\t\t\tDetect64BitPortabilityProblems=\"";const char* _DisableLanguageExtensions = "\n\t\t\t\tDisableLanguageExtensions=\"";const char* _DisableSpecificWarnings = "\n\t\t\t\tDisableSpecificWarnings=\"";const char* _EnableCOMDATFolding = "\n\t\t\t\tEnableCOMDATFolding=\"";const char* _EnableErrorChecks = "\n\t\t\t\tEnableErrorChecks=\"";const char* _EnableFiberSafeOptimizations = "\n\t\t\t\tEnableFiberSafeOptimizations=\"";const char* _EnableFunctionLevelLinking = "\n\t\t\t\tEnableFunctionLevelLinking=\"";const char* _EnableIntrinsicFunctions = "\n\t\t\t\tEnableIntrinsicFunctions=\"";const char* _EntryPointSymbol = "\n\t\t\t\tEntryPointSymbol=\"";const char* _ErrorCheckAllocations = "\n\t\t\t\tErrorCheckAllocations=\"";const char* _ErrorCheckBounds = "\n\t\t\t\tErrorCheckBounds=\"";const char* _ErrorCheckEnumRange = "\n\t\t\t\tErrorCheckEnumRange=\"";const char* _ErrorCheckRefPointers = "\n\t\t\t\tErrorCheckRefPointers=\"";const char* _ErrorCheckStubData = "\n\t\t\t\tErrorCheckStubData=\"";const char* _ExceptionHandling = "\n\t\t\t\tExceptionHandling=\"";const char* _ExcludedFromBuild = "\n\t\t\t\tExcludedFromBuild=\"";const char* _ExpandAttributedSource = "\n\t\t\t\tExpandAttributedSource=\"";const char* _ExportNamedFunctions = "\n\t\t\t\tExportNamedFunctions=\"";const char* _FavorSizeOrSpeed = "\n\t\t\t\tFavorSizeOrSpeed=\"";const char* _Filter = "\n\t\t\tFilter=\"";const char* _ForceConformanceInForLoopScope = "\n\t\t\t\tForceConformanceInForLoopScope=\"";const char* _ForceSymbolReferences = "\n\t\t\t\tForceSymbolReferences=\"";const char* _ForcedIncludeFiles = "\n\t\t\t\tForcedIncludeFiles=\"";const char* _ForcedUsingFiles = "\n\t\t\t\tForcedUsingFiles=\"";const char* _FullIncludePath = "\n\t\t\t\tFullIncludePath=\"";const char* _FunctionOrder = "\n\t\t\t\tFunctionOrder=\"";const char* _GenerateDebugInformation = "\n\t\t\t\tGenerateDebugInformation=\"";const char* _GenerateMapFile = "\n\t\t\t\tGenerateMapFile=\"";const char* _GeneratePreprocessedFile = "\n\t\t\t\tGeneratePreprocessedFile=\"";const char* _GenerateStublessProxies = "\n\t\t\t\tGenerateStublessProxies=\"";const char* _GenerateTypeLibrary = "\n\t\t\t\tGenerateTypeLibrary=\"";const char* _GlobalOptimizations = "\n\t\t\t\tGlobalOptimizations=\"";const char* _HeaderFileName = "\n\t\t\t\tHeaderFileName=\"";const char* _HeapCommitSize = "\n\t\t\t\tHeapCommitSize=\"";const char* _HeapReserveSize = "\n\t\t\t\tHeapReserveSize=\"";const char* _IgnoreAllDefaultLibraries = "\n\t\t\t\tIgnoreAllDefaultLibraries=\"";const char* _IgnoreDefaultLibraryNames = "\n\t\t\t\tIgnoreDefaultLibraryNames=\"";const char* _IgnoreEmbeddedIDL = "\n\t\t\t\tIgnoreEmbeddedIDL=\"";const char* _IgnoreImportLibrary = "\n\t\t\t\tIgnoreImportLibrary=\"";const char* _IgnoreStandardIncludePath = "\n\t\t\t\tIgnoreStandardIncludePath=\"";const char* _ImportLibrary = "\n\t\t\t\tImportLibrary=\"";const char* _ImproveFloatingPointConsistency = "\n\t\t\t\tImproveFloatingPointConsistency=\"";const char* _InlineFunctionExpansion = "\n\t\t\t\tInlineFunctionExpansion=\"";const char* _InterfaceIdentifierFileName = "\n\t\t\t\tInterfaceIdentifierFileName=\"";const char* _IntermediateDirectory = "\n\t\t\tIntermediateDirectory=\"";const char* _KeepComments = "\n\t\t\t\tKeepComments=\"";const char* _LargeAddressAware = "\n\t\t\t\tLargeAddressAware=\"";const char* _LinkDLL = "\n\t\t\t\tLinkDLL=\"";const char* _LinkIncremental = "\n\t\t\t\tLinkIncremental=\"";const char* _LinkTimeCodeGeneration = "\n\t\t\t\tLinkTimeCodeGeneration=\"";const char* _LinkToManagedResourceFile = "\n\t\t\t\tLinkToManagedResourceFile=\"";const char* _MapExports = "\n\t\t\t\tMapExports=\"";const char* _MapFileName = "\n\t\t\t\tMapFileName=\"";const char* _MapLines = "\n\t\t\t\tMapLines =\"";const char* _MergeSections = "\n\t\t\t\tMergeSections=\"";const char* _MergedIDLBaseFileName = "\n\t\t\t\tMergedIDLBaseFileName=\"";const char* _MidlCommandFile = "\n\t\t\t\tMidlCommandFile=\"";const char* _MinimalRebuild = "\n\t\t\t\tMinimalRebuild=\"";const char* _MkTypLibCompatible = "\n\t\t\t\tMkTypLibCompatible=\"";const char* _ModuleDefinitionFile = "\n\t\t\t\tModuleDefinitionFile=\"";const char* _Name1 = "\n\tName=\"";const char* _Name2 = "\n\t\tName=\"";const char* _Name3 = "\n\t\t\tName=\"";const char* _Name4 = "\n\t\t\t\tName=\"";const char* _Name5 = "\n\t\t\t\t\tName=\"";const char* _ObjectFile = "\n\t\t\t\tObjectFile=\"";const char* _OmitFramePointers = "\n\t\t\t\tOmitFramePointers=\"";const char* _Optimization = "\n\t\t\t\tOptimization =\"";const char* _OptimizeForProcessor = "\n\t\t\t\tOptimizeForProcessor=\"";const char* _OptimizeForWindows98 = "\n\t\t\t\tOptimizeForWindows98=\"";const char* _OptimizeForWindowsApplication = "\n\t\t\t\tOptimizeForWindowsApplication=\"";const char* _OptimizeReferences = "\n\t\t\t\tOptimizeReferences=\"";const char* _OutputDirectory3 = "\n\t\t\tOutputDirectory=\"";const char* _OutputDirectory4 = "\n\t\t\t\tOutputDirectory=\"";const char* _OutputFile = "\n\t\t\t\tOutputFile=\"";const char* _Outputs4 = "\n\t\t\t\tOutputs=\"";const char* _Outputs6 = "\n\t\t\t\t\t\tOutputs=\"";const char* _ParseFiles = "\n\t\t\tParseFiles=\"";const char* _PrecompiledHeaderFile = "\n\t\t\t\tPrecompiledHeaderFile=\"";const char* _PrecompiledHeaderThrough = "\n\t\t\t\tPrecompiledHeaderThrough=\"";const char* _PreprocessorDefinitions = "\n\t\t\t\tPreprocessorDefinitions=\"";const char* _PrimaryOutput = "\n\t\t\tPrimaryOutput=\"";const char* _ProjectGUID = "\n\tProjectGUID=\"";const char* _ProjectType = "\n\tProjectType=\"Visual C++\"";const char* _ProgramDatabase = "\n\t\t\tProgramDatabase=\"";const char* _ProgramDataBaseFileName = "\n\t\t\t\tProgramDataBaseFileName=\"";const char* _ProgramDatabaseFile = "\n\t\t\t\tProgramDatabaseFile=\"";const char* _ProxyFileName = "\n\t\t\t\tProxyFileName=\"";const char* _RedirectOutputAndErrors = "\n\t\t\t\tRedirectOutputAndErrors=\"";const char* _RegisterOutput = "\n\t\t\t\tRegisterOutput=\"";const char* _RelativePath = "\n\t\t\t\tRelativePath=\"";const char* _ResourceOnlyDLL = "\n\t\t\t\tResourceOnlyDLL=\"";const char* _ResourceOutputFileName = "\n\t\t\t\tResourceOutputFileName=\"";const char* _RuntimeLibrary = "\n\t\t\t\tRuntimeLibrary=\"";const char* _RuntimeTypeInfo = "\n\t\t\t\tRuntimeTypeInfo=\"";const char* _SccProjectName = "\n\tSccProjectName=\"";const char* _SccLocalPath = "\n\tSccLocalPath=\"";const char* _SetChecksum = "\n\t\t\t\tSetChecksum=\"";const char* _ShowIncludes = "\n\t\t\t\tShowIncludes=\"";const char* _ShowProgress = "\n\t\t\t\tShowProgress=\"";const char* _SmallerTypeCheck = "\n\t\t\t\tSmallerTypeCheck=\"";const char* _StackCommitSize = "\n\t\t\t\tStackCommitSize=\"";const char* _StackReserveSize = "\n\t\t\t\tStackReserveSize=\"";const char* _StringPooling = "\n\t\t\t\tStringPooling=\"";const char* _StripPrivateSymbols = "\n\t\t\t\tStripPrivateSymbols=\"";const char* _StructMemberAlignment = "\n\t\t\t\tStructMemberAlignment=\"";const char* _SubSystem = "\n\t\t\t\tSubSystem=\"";const char* _SupportUnloadOfDelayLoadedDLL = "\n\t\t\t\tSupportUnloadOfDelayLoadedDLL=\"";const char* _SuppressStartupBanner = "\n\t\t\t\tSuppressStartupBanner=\"";const char* _SwapRunFromCD = "\n\t\t\t\tSwapRunFromCD=\"";const char* _SwapRunFromNet = "\n\t\t\t\tSwapRunFromNet=\"";const char* _TargetEnvironment = "\n\t\t\t\tTargetEnvironment=\"";const char* _TargetMachine = "\n\t\t\t\tTargetMachine=\"";const char* _TerminalServerAware = "\n\t\t\t\tTerminalServerAware=\"";const char* _ToolName = "\n\t\t\t\tName=\"";const char* _ToolPath = "\n\t\t\t\tPath=\"";const char* _TreatWChar_tAsBuiltInType = "\n\t\t\t\tTreatWChar_tAsBuiltInType=\"";const char* _TurnOffAssemblyGeneration = "\n\t\t\t\tTurnOffAssemblyGeneration=\"";const char* _TypeLibraryFile = "\n\t\t\t\tTypeLibraryFile=\"";const char* _TypeLibraryName = "\n\t\t\t\tTypeLibraryName=\"";const char* _TypeLibraryResourceID = "\n\t\t\t\tTypeLibraryResourceID=\"";const char* _UndefineAllPreprocessorDefinitions = "\n\t\t\t\tUndefineAllPreprocessorDefinitions=\"";const char* _UndefinePreprocessorDefinitions = "\n\t\t\t\tUndefinePreprocessorDefinitions=\"";const char* _UseOfATL = "\n\t\t\tUseOfATL=\"";const char* _UseOfMfc = "\n\t\t\tUseOfMfc=\"";const char* _UsePrecompiledHeader = "\n\t\t\t\tUsePrecompiledHeader=\"";const char* _ValidateParameters = "\n\t\t\t\tValidateParameters=\"";const char* _VCCLCompilerToolName = "\n\t\t\t\tName=\"VCCLCompilerTool\"";const char* _VCCustomBuildTool = "\n\t\t\t\t\t\tName=\"VCCustomBuildTool\"";const char* _VCLinkerToolName = "\n\t\t\t\tName=\"VCLinkerTool\"";const char* _VCResourceCompilerToolName = "\n\t\t\t\tName=\"VCResourceCompilerTool\"";const char* _VCMIDLToolName = "\n\t\t\t\tName=\"VCMIDLTool\"";const char* _Version1 = "\n\tVersion=\"";const char* _Version4 = "\n\t\t\t\tVersion=\"";const char* _WarnAsError = "\n\t\t\t\tWarnAsError=\"";const char* _WarnLevel = "\n\t\t\t\tWarnLevel=\"";const char* _WarningLevel = "\n\t\t\t\tWarningLevel=\"";const char* _WholeProgramOptimization = "\n\t\t\t\tWholeProgramOptimization=\"";// Property name and value as Pairs ---------------------------------struct TPair { TPair( const char* n, const triState v ) : name(n), value(v) {}; const char* name; const triState value;};struct EPair { EPair( const char* n, const int v ) : name(n), value(v) {}; const char* name; const int value;};struct LPair { LPair( const char* n, const long v ) : name(n), value(v) {}; const char* name; const long value;};struct SPair { SPair( const char* n, const QString& v ) : name(n), value(v) {}; const char* name; const QString& value;};struct XPair { XPair( const char* n, const QStringList& v, const char* s = "," ) : name(n), value(v), sep(s) {}; const char* name; const QStringList& value; const char* sep;};// void streamSPair( QTextStream &strm, const char *n, const QString &s )// Streaming operators for property Pairs ---------------------------QTextStream &operator<<( QTextStream &strm, const TPair &prop ){ switch( prop.value ) { case _False: strm << prop.name << "FALSE\""; break; case _True: strm << prop.name << "TRUE\""; break; case unset: default: break; } return strm;}/* Be sure to check that each enum is not set to default before streaming it out. Defaults seem to not be in the XML file.*/QTextStream &operator<<( QTextStream &strm, const EPair &prop ){ strm << prop.name << prop.value << "\""; return strm;}QTextStream &operator<<( QTextStream &strm, const LPair &prop ){ strm << prop.name << prop.value << "\""; return strm;}QTextStream &operator<<( QTextStream &strm, const SPair &prop ){ if ( !prop.value.isEmpty() ) strm << prop.name << QString(prop.value).remove("\"") << "\""; return strm;}QTextStream &operator<<( QTextStream &strm, const XPair &prop ){ if ( !prop.value.isEmpty() ) strm << prop.name << prop.value.join(prop.sep).latin1() << "\""; return strm;}// VCCLCompilerTool -------------------------------------------------VCCLCompilerTool::VCCLCompilerTool() : AssemblerOutput( asmListingNone ), BasicRuntimeChecks( runtimeBasicCheckNone ), BrowseInformation( brInfoNone ), BufferSecurityCheck( _False ), CallingConvention( callConventionDefault ), CompileAs( compileAsDefault ), CompileAsManaged( managedDefault ), CompileOnly( unset ), DebugInformationFormat( debugDisabled ), DefaultCharIsUnsigned( unset ), Detect64BitPortabilityProblems( unset ), DisableLanguageExtensions( unset ), EnableFiberSafeOptimizations( unset ), EnableFunctionLevelLinking( unset ), EnableIntrinsicFunctions( unset ), ExceptionHandling( _False ), ExpandAttributedSource( unset ), FavorSizeOrSpeed( favorNone ), ForceConformanceInForLoopScope( unset ), GeneratePreprocessedFile( preprocessNo ),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -