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

📄 astyle.html

📁 一个强大的源代码格式化程序
💻 HTML
📖 第 1 页 / 共 5 页
字号:
				<p><font color="#000080" size="3"><b>-M</b></font><font color="#ff0000" size="4"><b>#</b></font><font size="3">
						OR </font><font color="#000080" size="3"><b>--max-instatement-indent=</b></font><font color="#ff0000" size="3"><b>#</b></font><font color="#000080" size="4"><b>
							<br>
						</b></font>Indent a maximal <font color="#ff0000">#</font> spaces in a 
					continuous statement, relatively to the previous line (e.g. <strong>--max-instatement-indent=</strong><font color="#ff0000" size="3"><strong>40</strong></font>)
				</p>
				<p><font color="#000080" size="4"><b>-m</b></font><font color="#ff0000" size="4"><b>#</b></font><font size="3">
						OR</font><b> <font color="#000080" size="4">--</font><font color="#000080" size="3">min-conditional</font></b><font color="#000080" size="3"><b>-indent=</b></font><font color="#ff0000" size="3"><b>#</b></font><font size="2"><br>
					</font>Set the minimal indent that is added when a header is built of 
					multiple-lines. This indent makes helps to easily separate the header from the 
					command statements that follow. The default setting for this option is <font color="#ff0000">
						twice the current indent</font>. (e.g. <strong>--min-conditional-indent=<font color="#ff0000">8</font></strong>)
				</p>
				<blockquote>
					<p><font color="#330000">The default:</font></p>
				</blockquote><blockquote>
					<p><font color="#800080"><b><tt>// default setting makes this non-bracketed code clear<br>
									if (a &lt; b<br>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || c &gt; d)<br>
									&nbsp;&nbsp;&nbsp; foo++;<br>
									<br>
									// but creates an exaggerated indent in this bracketed code<br>
									if (a &lt; b<br>
									&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; || c &gt; d)<br>
								</tt></b></font><font color="#ff0000"><b><tt>{</tt></b></font><font color="#800080"><b><tt><br>
									&nbsp;&nbsp;&nbsp; foo++;<br>
								</tt></b></font><font color="#ff0000"><b><tt>}</tt></b></font></p>
					<p><font color="#330000">When setting <b>--min-conditional=0</b> :</font></p>
					<p><font color="#800080"><b><tt>// setting makes this non-bracketed code less clear<br>
									if (a &lt; b<br>
									&nbsp;&nbsp;&nbsp; || c &gt; d)<br>
									&nbsp;&nbsp;&nbsp; foo++;<br>
									<br>
									// but makes this bracketed code prettier<br>
									if (a &lt; b<br>
									&nbsp;&nbsp;&nbsp; || c &gt; d)<br>
								</tt></b></font><font color="#ff0000"><b><tt>{</tt></b></font><font color="#800080"><b><tt><br>
									&nbsp;&nbsp;&nbsp; foo++;<br>
								</tt></b></font><font color="#ff0000"><b><tt>}</tt></b></font></p>
				</blockquote>
				<p><font> <FONT color="#000080"><FONT size="4"><STRONG><FONT size="3">--indent-preprocessor</FONT><BR>
								</STRONG><FONT color="#000000" size="3">Indent&nbsp;multi-line preprocessor 
									definitions. should be used with <STRONG>--convert-tabs</STRONG> for proper 
									results. Does a pretty good job, but can not perform miracles in obfuscated 
									preprocessor definitions.</FONT></FONT></FONT></font>
				</p>
				<p><STRONG><FONT color="#000080">--convert-tabs<BR>
						</FONT></STRONG><FONT color="#000000" size="3">Converts tabs into single 
						spaces.</FONT>
				</p>
				<p><font color="#000080" size="4"><STRONG>-E</STRONG></font><font size="3"> OR</font><b>
						<font color="#000080" size="4">--</font><font color="#000080" size="3">fill-empty-lines</font></b><font size="2"><br>
					</font><font size="3">Fill empty lines with the white space of their previous 
						lines.</font>
				</p>
			</blockquote>
			<h3><font color="#000000" size="4">The following </font><font color="#000099" size="4">formatting</font><font color="#000000" size="4"><b>
						options</b> are currently available:</font></h3>
			<blockquote>
				<p><font color="#000080" size="3"><b>-b</b></font><font size="3"> OR </font><font color="#000080" size="3">
						<strong>--brackets=break</strong></font><font size="3"><br>
						Break brackets&nbsp; from their pre-block statements ( i.e. ANSI C, C++ style 
						).</font>
				</p>
				<blockquote>
					<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>{</tt></b></font>
						<br>
						<font size="3"><b><tt>&nbsp;&nbsp;&nbsp; </tt></b></font><font color="#993399" size="3">
							<b><tt>bar();</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>}</tt></b></font>
						<br>
						<font color="#993399" size="3"><b><tt>else</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>{</tt></b></font>
						<br>
						<font size="3"><b><tt>&nbsp;&nbsp;&nbsp; </tt></b></font><font color="#993399" size="3">
							<b><tt>anotherBar();</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
				</blockquote>
				<p><font color="#000080" size="3"><b>-a</b></font><font size="3"> OR </font><font color="#000080" size="3">
						<strong>--brackets=attach</strong></font><font size="3"><br>
						Attach brackets to their pre-block statements ( i.e. Java , K&amp;R style ).</font>
				</p>
				<blockquote>
					<p><font color="#993399" size="3"><b><tt>if (isFoo)</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font>
						<br>
						<font size="3"><b><tt>&nbsp;&nbsp;</tt></b></font><font color="#993399" size="3"><b><tt>&nbsp; 
									bar();</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>}</tt></b></font><font size="3"><b><tt> </tt></b>
						</font><font color="#993399" size="3"><b><tt>else </tt></b></font><font color="#ff0000" size="3">
							<b><tt>{</tt></b></font>
						<br>
						<font size="3"><b><tt>&nbsp;&nbsp;&nbsp;</tt></b></font><font color="#993399" size="3"><b><tt>
									anotherBar();</tt></b></font>
						<br>
						<font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
				</blockquote>
				<p><font color="#000080" size="3"><b>-l</b></font><font size="3"> OR </font><font color="#000080" size="3">
						<strong>--brackets=linux</strong></font><font size="3"><br>
					</font>Break brackets from class/function declarations, but attach brackets to <font size="3">
						pre-block </font>command statements.</p>
				<blockquote>
					<p><font color="#800080" size="3"><b><tt>namespace foospace<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
									&nbsp;&nbsp;&nbsp; int Foo()<br>
									&nbsp;&nbsp;&nbsp; </tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (isBar)</tt></b></font><font color="#ff0000" size="3"><b><tt>
									{</tt></b></font><font color="#800080" size="3"><b><tt><br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bar();<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 1;<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </tt></b></font><font color="#ff0000" size="3">
							<b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt> else<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return 0;<br>
									&nbsp;&nbsp;&nbsp; </tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt><br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
				</blockquote><font color="#000080" size="3">
					<P><FONT><FONT color="navy" size="3"><STRONG>--brackets=break-closing-headers</STRONG></FONT></FONT><FONT size="3"><BR>
							<FONT color="black">When used with either <STRONG>'--brackets=attach'</STRONG> or <STRONG>
									'--brackets= linux'</STRONG> , breaks closing headers (e.g. 'else', 
								'catch', ...) from their immediately preceding closing brackets.).</FONT></FONT>
					</P>
					<BLOCKQUOTE><FONT color="#993399" size="3"><TT>
								<P><FONT color="#993399" size="3"><TT><STRONG>if (isFoo)<FONT color="#ff0000" size="3"><TT>{</TT></FONT></STRONG><STRONG><FONT color="#000080"><FONT face="Times New Roman">
														<BR>
													</FONT><FONT size="3"><TT>&nbsp;&nbsp;</TT></FONT></FONT><FONT color="#993399" size="3"><TT>&nbsp; 
														bar();</TT></FONT></STRONG><STRONG><FONT face="Times New Roman" color="#000080">
													<BR>
												</FONT><FONT color="#ff0000" size="3"><TT>}</TT></FONT><FONT color="#000080" size="3"><TT></TT></FONT><FONT color="#993399" size="3"><TT>else
													</TT></FONT><FONT color="#ff0000" size="3"><TT>{</TT></FONT></STRONG><STRONG><FONT color="#000080"><FONT face="Times New Roman">
														<BR>
													</FONT><FONT size="3"><TT>&nbsp;&nbsp;&nbsp;</TT></FONT></FONT><FONT color="#993399" size="3"><TT>
														anotherBar();</TT></FONT></STRONG><STRONG><FONT face="Times New Roman" color="#000080">
													<BR>
												</FONT><FONT color="#ff0000" size="3"><TT>}</TT></FONT></STRONG></TT></FONT></P>
								<FONT color="#ff0000" size="3"><TT>
										<p><STRONG><font face="Times New Roman" color="#330000" size="3">becomes:</font> </STRONG>
										</p>
										<p>
									</TT></FONT><STRONG>if (isFoo) </STRONG></TT></FONT><STRONG><FONT color="#ff0000" size="3">
								<TT>{</TT></FONT>
							<BR>
							<FONT size="3"><TT>&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT>&nbsp; 
									bar();</TT></FONT>
							<BR>
							<FONT color="#ff0000" size="3"><TT>}</TT></FONT></STRONG><STRONG><FONT size="3"><TT>
									<BR>
								</TT></FONT><FONT color="#993399" size="3"><TT>else </TT></FONT><FONT color="#ff0000" size="3">
								<TT>{</TT></FONT>
							<BR>
							<FONT size="3"><TT>&nbsp;&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT> anotherBar();</TT></FONT>
							<BR>
							<FONT color="#ff0000" size="3"><TT>}</TT></FONT></STRONG></P></BLOCKQUOTE>
					<P><FONT color="#ff0000" size="3"><TT></TT></FONT>&nbsp;</P>
					<P><FONT size="+0"><FONT color="navy" size="3"><STRONG>--break-blocks</STRONG></FONT></FONT><FONT size="3"><BR>
							<FONT color="#000000"><STRONG>Pad empty lines around header blocks (e.g.&nbsp;'if', 
									'while'...).</STRONG> </FONT></FONT>
					</P>
					<BLOCKQUOTE>
						<P><STRONG><FONT color="#993399" size="3"><TT>isFoo = true;<BR>
									</TT></FONT><FONT color="#993399" size="3"><TT>if (isFoo) <FONT color="#ff0000">{</FONT>
									</TT></FONT>
								<BR>
								<FONT size="3"><TT>&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT>&nbsp; 
										bar();</TT></FONT>
								<BR>
								<FONT color="#993399" size="3"><TT><FONT color="#ff0000">} </FONT>else</TT></FONT>&nbsp;<FONT face="Courier New" color="#ff0000">{</FONT><BR>
								<FONT size="3"><TT>&nbsp;&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT> anotherBar();</TT></FONT>
							</STRONG><FONT color="#ff0000" size="3"><TT>
									<BR>
									<FONT color="purple"><FONT color="#993399"><STRONG><FONT color="#ff0000">}<BR>
												</FONT>isBar = false;</STRONG></FONT></FONT></TT></FONT></P>
						<FONT color="#ff0000" size="3"><TT>
								<p><STRONG><font face="Times New Roman" color="#330000" size="3">becomes:</font> </STRONG>
								</p>
								<p><font color="#993399" size="3"><tt><STRONG>isFoo = true;<BR>
												<BR>
												<FONT color="#993399" size="3"><TT>if (isFoo) <FONT color="#ff0000">{</FONT> </TT></FONT>
												<BR>
												<FONT size="3"><TT>&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT>&nbsp; 
														bar();</TT></FONT>
												<BR>
												<FONT color="#993399" size="3"><TT><FONT color="#ff0000">} </FONT>else</TT></FONT>&nbsp;<FONT color="#ff0000">{</FONT><BR>
												<FONT size="3"><TT>&nbsp;&nbsp;&nbsp;</TT></FONT><FONT color="#993399" size="3"><TT> anotherBar();</TT></FONT>
												<BR>
											</STRONG><STRONG><FONT color="#ff0000" size="3"><TT>}<BR>
														<BR>
														<FONT color="purple"><FONT color="#993399">isBar = false;</FONT></FONT></TT></FONT>
											</STRONG></tt></font>
								</p>
							</TT></FONT></BLOCKQUOTE>
					<P><FONT size="+0"><FONT color="navy" size="3"><STRONG>--break-blocks=all</STRONG></FONT></FONT><FONT size="3"><BR>
							<FONT color="#000000"><STRONG>Pad empty lines around header blocks (e.g.&nbsp;'if', 

⌨️ 快捷键说明

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