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

📄 cppnetcompilerparameters.cs

📁 c#源代码
💻 CS
📖 第 1 页 / 共 4 页
字号:
					case PreCompiledHeader.Use:
						result.Append("/Yu");
						AppendHeaderFile(result);
						break;
					case PreCompiledHeader.CreateAutomatically:
						result.Append("/YX");
						AppendHeaderFile(result);
						break;

//					case PreCompiledHeader.Create:
//						result.Append("/Yc");
//						AppendHeaderFile(result);
//						break;
//					case PreCompiledHeader.Use:
//						result.Append("/Yu");
//						AppendHeaderFile(result);
//						break;
//					case PreCompiledHeader.CreateAutomatically:
//						result.Append("/YX");
//						AppendHeaderFile(result);
//						break;
				}
				
				if (IsNotEmpty(preCompiledHeaderFile)) {
					AppendOption(result, "/Fp", preCompiledHeaderFile);
				}
			
				return result.ToString();
			}
		}
		#endregion
		
		#region Output File Options
		[XmlNodeName("OutputFileCPPOptions")]
		public class OutputFileCPPOptions
		{
			[XmlAttribute("extendSourceWithAttributes")]
			public bool extendSourceWithAttributes = false;
			 
			[XmlAttribute("assemblyOutput")]
			public AssemblyOutput assemblyOutput = AssemblyOutput.NoList;
			
			[XmlAttribute("assemblerListSaveLocation")]
			public string assemblerListSaveLocation = "";
			
			[XmlAttribute("objectName")]
			public string objectName = "";
			
			[XmlAttribute("programDatabaseName")]
			public string programDatabaseName = "";
			
			public bool ExtendSourceWithAttributes {
				get {
					return extendSourceWithAttributes;
				}
				set {
					extendSourceWithAttributes = value;
				}
			}
			public AssemblyOutput AssemblyOutput {
				get {
					return assemblyOutput;
				}
				set {
					assemblyOutput = value;
				}
			}
			public string AssemblerListSaveLocation {
				get {
					return assemblerListSaveLocation;
				}
				set {
					assemblerListSaveLocation = value;
				}
			}
			public string ObjectName {
				get {
					return objectName;
				}
				set {
					objectName = value;
				}
			}
			public string ProgramDatabaseName {
				get {
					return programDatabaseName;
				}
				set {
					programDatabaseName = value;
				}
			}
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
				
				if (extendSourceWithAttributes) {
					result.Append("/Fx\n");
				}
				
				switch (assemblyOutput) {
					case AssemblyOutput.ListAssembly:
						result.Append("/FA\n");
						break;
					case AssemblyOutput.ListAssemblyWithCode:
						result.Append("/FAc\n");
						break;
					case AssemblyOutput.ListAssemblyWithCodeAndSource:
						result.Append("/FAcs\n");
						break;
					case AssemblyOutput.ListAssemblyWithSource:
						result.Append("/FAs\n");
						break;
					case AssemblyOutput.NoList:
						break;
				}
			
				if (IsNotEmpty(assemblerListSaveLocation))
				{
					AppendOption(result, "/Fa", assemblerListSaveLocation);
				}
			
				if (IsNotEmpty(objectName)) 
				{
					AppendOption(result, "/Fo", objectName);
				}
			
				if (IsNotEmpty(programDatabaseName)) 
				{
					AppendOption(result, "/Fd", programDatabaseName);
				}
				return result.ToString();
			}
		}
		#endregion
		
		#region Information Search Options
		[XmlNodeName("InformationSearchCPPOptions")]
		public class InformationSearchCPPOptions
		{
			[XmlAttribute("activateBrowseInformation")]
			public bool activateBrowseInformation = false;
			
			[XmlAttribute("browseFile")]
			public string  browseFile = "";
			
			public bool ActivateBrowseInformation {
				get {
					return activateBrowseInformation;
				}
				set {
					activateBrowseInformation = value;
				}
			}
			public string BrowseFile {
				get {
					return browseFile;
				}
				set {
					browseFile = value;
				}
			}
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
				if (activateBrowseInformation) {
					result.Append("/FR");
					if (IsNotEmpty(browseFile)) 
					{
						result.Append(browseFile);
					}
					result.Append("\n");
				}
				return result.ToString();
			}
		}
		#endregion
		
		#region Extended Options
		[XmlNodeName("ExtendedCPPOptions")]
		public class ExtendedCPPOptions
		{
			[XmlAttribute("callingConvention")]
			public CallingConvention callingConvention = CallingConvention.__cdecl;
			
			[XmlAttribute("compileType")]
			public CompileType compileType = CompileType.CPP;
			
			[XmlAttribute("surpressedWarnings")]
			public string surpressedWarnings = "";
			
			[XmlAttribute("forcedIncludes")]
			public string forcedIncludes = "";
			
			[XmlAttribute("forcedUsings")]
			public string forcedUsings = "";
			
			[XmlAttribute("showIncludes")]
			public bool showIncludes = false;
			
			[XmlAttribute("overridePreProcessorDirectives")]
			public string overridePreProcessorDirectives = "";
			
			[XmlAttribute("overrideAllPreProcessorDirectives")]
			public bool overrideAllPreProcessorDirectives = false;
			
			public CallingConvention CallingConvention {
				get {
					return callingConvention;
				}
				set {
					callingConvention = value;
				}
			}
			public CompileType CompileType {
				get {
					return compileType;
				}
				set {
					compileType = value;
				}
			}
			public string SurpressedWarnings {
				get {
					return surpressedWarnings;
				}
				set {
					surpressedWarnings = value;
				}
			}
			public string ForcedIncludes {
				get {
					return forcedIncludes;
				}
				set {
					forcedIncludes = value;
				}
			}
			public string ForcedUsings {
				get {
					return forcedUsings;
				}
				set {
					forcedUsings = value;
				}
			}
			public bool ShowIncludes {
				get {
					return showIncludes;
				}
				set {
					showIncludes = value;
				}
			}
			public string OverridePreProcessorDirectives {
				get {
					return overridePreProcessorDirectives;
				}
				set {
					overridePreProcessorDirectives = value;
				}
			}
			public bool OverrideAllPreProcessorDirectives {
				get {
					return overrideAllPreProcessorDirectives;
				}
				set {
					overrideAllPreProcessorDirectives = value;
				}
			}
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
				switch (CallingConvention) {
					case CallingConvention.__cdecl:
						result.Append("/Gd\n");
						break;
					case CallingConvention.__fastcall:
						result.Append("/Gr\n");
						break;
					case CallingConvention.__stdcall:
						result.Append("/Gz\n");
						break;
				}
				
				switch (CompileType) {
					case CompileType.C:
						result.Append("/TC\n");
						break;
					case CompileType.CPP:
						result.Append("/TP\n");
						break;
					case CompileType.Standard:
						break;
				}
			
				if (IsNotEmpty(surpressedWarnings))
				{
					AppendList(result, "/wd", surpressedWarnings);
				}
			
				if (IsNotEmpty(forcedIncludes))
				{
					AppendList(result, "/FI", forcedIncludes, true);
				}
			
				if (IsNotEmpty(forcedUsings))
				{
					AppendList(result, "/FU", forcedUsings, true);
				}
			
				if (showIncludes)
				{
					result.Append("/showIncludes\n");
				}
			
				if (overrideAllPreProcessorDirectives)
				{
					result.Append("/u\n");
				}
				else
				{
					if (IsNotEmpty(overridePreProcessorDirectives))
					{
						AppendList(result, "/U", overridePreProcessorDirectives);
					}
				}
			
				return result.ToString();
			}
		}
		#endregion

		#region General Linker Options
		[XmlNodeName("GeneralLinkerOptions")]
		public class GeneralLinkerOptions : LocalizedObject
		{
			[XmlAttribute("outputFile")]
			[ConvertToRelativePath()]
			public string outputFile = "a.exe";
			
			[XmlAttribute("showLinkerStatus")]
			public ShowLinkerStatus showLinkerStatus = ShowLinkerStatus.Unselected;
			
			[XmlAttribute("version")]
			public string version = "";
			
			[XmlAttribute("incrementalLinking")]
			public IncrementalLinking incrementalLinking = IncrementalLinking.Standard;
			
			[XmlAttribute("surpressStartLogo")]
			public bool surpressStartLogo = false;
			
			[XmlAttribute("additionalLinkerOptions")]
			public string additionalLinkerOptions = "";
			
//			[XmlAttribute("ignoreImportLibrary")]
//			public bool ignoreImportLibrary = true;
			
//			[XmlAttribute("registerOutput")]
//			public bool registerOutput = false;
			
			[XmlAttribute("additionalLibraryDirectories")]
			public string additionalLibraryDirectories = "";
			
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
//				result.Append("/OUT:");result.Append(outputFile);result.Append("\n");
				switch (ShowLinkerStatus) {
					case ShowLinkerStatus.ShowAll:
						result.Append("/VERBOSE\n");
						break;
					case ShowLinkerStatus.ShowSome:
						result.Append("/VERBOSE:LIB\n");
						break;
					
				}
				if (IsNotEmpty(version)) {
					result.Append("/VERSION:").Append(version).Append("\n");
				}
				
				switch (IncrementalLinking) {
					case IncrementalLinking.Standard:
						break;
					case IncrementalLinking.No:
						result.Append("/INCREMENTAL:NO\n");
						break;
					case IncrementalLinking.Yes:
						result.Append("/INCREMENTAL\n");
						break;
				}
				
				if (SurpressStartLogo) {
					result.Append("/NOLOGO\n");
				}
				
				if (IsNotEmpty(AdditionalLibraryDirectories)) {
					AppendList(result, "/LIBPATH:", AdditionalLibraryDirectories, true);
				}
				result.Append(additionalLinkerOptions);
				result.Append("\n");
				return result.ToString();
			}
			
			[LocalizedProperty("Output File",
			                   Description = "Specifies the name of the output file. (/OUT:[file])")]
			public string OutputFile {
				get {
					return outputFile;
				}
				set {
					outputFile = value;
				}
			}
			
			[DefaultValue(ShowLinkerStatus.Unselected)]
			[LocalizedProperty("Show Status",
			                   Description = "Shows detailed progress status. (/VERBOSE, /VERBOSE:LIB)")]
			public ShowLinkerStatus ShowLinkerStatus {
				get {
					return showLinkerStatus;
				}
				set {
					showLinkerStatus = value;
				}
			}
			
			[DefaultValue("")]
			[LocalizedProperty("Version",
			                   Description = "Use this value as the version number in created image header. (/VERSION:[version])")]
			public string Version {
				get {
					return version;
				}
				set {
					version = value;
				}
			}
			
			[DefaultValue(IncrementalLinking.Standard)]
			[LocalizedProperty("Enable Incremental Linking",
			                   Description = "Enables incremental linking. (/INCREMENTAL, /INCREMENTAL:NO)")]
			public IncrementalLinking IncrementalLinking {
				get {
					return incrementalLinking;
				}
				set {
					incrementalLinking = value;
				}
			}
			
			[DefaultValue(false)]
			[LocalizedProperty("Surpress Startup Logo",
			                   Description = "Surpress the display of the startup logo and information messages. (/NOLOGO)")]
			public bool SurpressStartLogo {
				get {
					return surpressStartLogo;
				}
				set {
					surpressStartLogo = value;
				}
			}
			
//			[DefaultValue(true)]			
//			[LocalizedProperty("Ignore Import Library",
//			                   Description = "Specifies that the import library generated by this configuration should not be imported into dependent projects.")]
//			public bool IgnoreImportLibrary {
//				get {
//					return ignoreImportLibrary;
//				}
//				set {
//					ignoreImportLibrary = value;
//				}
//			}
			
//			[LocalizedProperty("Register Output",
//			                   Description = "Specifies whether to register the primary output of this build.")]
//			public bool RegisterOutput {
//				get {
//					return registerOutput;
//				}
//				set {
//					registerOutput = value;
//				}
//			}
			
			[DefaultValue("")]
			[LocalizedProperty("Additional Library Directories",
			                   Description = "Specifies one or more semi-colon delimited additonal paths to search for libraries. (/LIBPATH:[path])")]
			public string AdditionalLibraryDirectories {
				get {
					return additionalLibraryDirectories;
				}
				set {
					additionalLibraryDirectories = value;
				}
			}
			
			[DefaultValue("")]
			[LocalizedProperty("Additional Linker Options",
			                   Description = "Specifies additional options given to the linker.")]
			public string AdditionalLinkerOptions {
				get {
					return additionalLinkerOptions;
				}
				set {
					additionalLinkerOptions = value;
				}
			}
			
			
		}
		#endregion
		
		#region Input Linker Options
		[XmlNodeName("InputLinkerOptions")]
		public class InputLinkerOptions
		{
			[XmlAttribute("additionalDependencies")]
			public string additionalDependencies = "";
			
			[XmlAttribute("ignoreStandardLibrary")]
			public bool ignoreStandardLibrary = false;
			
			[XmlAttribute("ignoreLibrary")]
			public string ignoreLibrary = "";
			
			[XmlAttribute("moduleDefinition")]
			public string moduleDefinition = "";
			
			[XmlAttribute("addModuleToAssembly")]
			public string addModuleToAssembly = "";
			
			[XmlAttribute("embedResourceToAssembly")]
			public string embedResourceToAssembly = "";
			
			[XmlAttribute("forcedSymbolLinks")]
			public string forcedSymbolLinks = "";
			
			[XmlAttribute("laterLoadedDLLs")]
			public string laterLoadedDLLs = "";
			
			public string GetCommandLineParameters()
			{
				StringBuilder result = new StringBuilder();
				if (ignoreStandardLibrary) 
				{
					result.Append("/NODEFAULTLIB\n");	
				}
				else 
				{
					if (IsNotEmpty(ignoreLibrary)) 
					{
						AppendList(result, "/NODEFAULTLIB:", ignoreLibrary);
					}
				}
				if (IsNotEmpty(additionalDependencies)) 
				{
					AppendList(result, "", additionalDependencies);
				}
				if (IsNotEmpty(moduleDefinition))
				{
					result.Append("/DEF:");	
					result.Append(moduleDefinition);
					result.Append("\n");	

⌨️ 快捷键说明

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