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

📄 astyle.html

📁 一个强大的源代码格式化程序
💻 HTML
📖 第 1 页 / 共 5 页
字号:
									brackets=attach<br>
								</tt></font><font color="#ff0000" size="3" face="Times New Roman"><tt># set 6 
									spaces per indent</tt></font><font color="#800080" size="3" face="Times New&#13;&#10;&#13;&#10;                Roman">&lt;tt&gt;&lt;br&gt;indent=spaces=6<br>
								</TT></font><font color="#ff0000" size="3" face="Times New Roman"><tt># indent 
									switch blocks</tt></font><font color="#800080" size="3" face="Times New Roman"><tt><br>
									indent-switches</tt></font><font color="#000000" size="3"><br>
							</font><font color="#ff0000" size="3" face="Times New Roman"><tt># suffix of original 
									files should be .pre</tt></font><font color="#000000" size="3" face="Times New Roman"><tt><br>
								</tt></font><font color="#800080" size="3" face="Times New Roman"><tt>suffix=.pre<br>
								</tt></font>
						</p>
					</blockquote>
				</li>
			</ul>
			<p><font color="#000000" size="4">The following </font><font color="#000099" size="4"><b>predefined 
						style</b></font><font color="#000000" size="4"><b> options</b> are 
					currently avaiable:</font></p>
			<blockquote>
				<p><font color="#000080" size="3"><strong>--style=ansi</strong></font><font color="#000000" size="3"><br>
					</font>ANSI style formatting/indenting.</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)<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><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><br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 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>
				<p><font color="#000080"><strong>--style=kr</strong></font><br>
					Kernighan&amp;Ritchie style formatting/indenting.</p>
				<blockquote>
					<p><font color="#800080" size="3"><b><tt>namespace foospace</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()</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>
				<p><font color="#000080"><strong>--style=linux</strong></font><br>
					Linux style formatting/indenting (brackets are broken apart from class/function 
					declarations, but connected to command lines, and indents are set to 8 spaces).</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; &nbsp;&nbsp;&nbsp; int Foo()<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><br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &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; &nbsp;&nbsp;&nbsp; 
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; bar();<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 1;<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &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 </tt></b></font><font color="#800080" size="3"><b><tt>
									<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; 
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<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><br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
				</blockquote>
				<p><font color="#000080"><strong>--style=gnu</strong></font><br>
					GNU style formatting/indenting.</p>
				<blockquote>
					<p><font color="#800080" size="3"><b><tt>namespace foospace<br>
									&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; int Foo()<br>
									&nbsp;&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)<br>
									&nbsp;&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><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; &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; else<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;return 0;<br>
									&nbsp;&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>
				<p><font color="#000080"><strong>--style=java</strong></font><br>
					Java style formatting/indenting.</p>
				<blockquote>
					<p><font color="#800080" size="3"><b><tt>class foospace</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()</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></blockquote>
			<p><font color="#000000" size="4">The following </font><font color="#000099" size="4"><b>indentation</b></font><font color="#000000" size="4"><b>
						options</b> are currently available:</font></p>
		</blockquote><blockquote> <blockquote>
				<p><font color="#000080" size="3"><b>-c</b></font><font color="#000080" size="4"><b> </b>
					</font><font size="3">OR </font><font color="#000080" size="3"><strong>--mode=c</strong></font><font size="3"><br>
						Indent a C, C++ or C#&nbsp;file.</font><font size="2"> </font>
				</p>
				<p><font color="#000080" size="3"><b>-j</b></font><font size="3"> OR </font><font color="#000080" size="3">
						<strong>--mode=java</strong></font><font size="3"><br>
						Indent a Java file.</font><font size="2"> </font>
				</p>
				<p><font color="#000080" size="4"><b>-s</b></font><font color="#ff0000" size="4"><b>#</b></font><font size="3">
						OR </font><font color="#000080" size="3"><strong>--indent=spaces=</strong></font><font color="#ff0000" size="3"><strong>#</strong></font><font size="3"><br>
						Indent using </font><font color="#ff0000" size="3">#</font><font size="3"> spaces 
						per indent (e.g. </font><font size="4"><b>-s</b></font><font color="#ff0000" size="3"><b>4</b></font><font size="3">
						OR <strong>--indent=spaces=</strong></font><font color="#ff0000" size="3"><strong>4</strong></font><font size="3">).</font>
				</p>
				<p><font color="#000080" size="4"><strong>-t </strong><font color="#000000" size="3">OR</font><strong>
							-t<font color="red">#</font></strong></font><font size="3"> OR </font><font color="#000080" size="3">
						<strong>--indent=tab=<font color="red">#</font></strong></font><font size="3"><br>
						Indent using tab characters.</font> Treat each tab as <font color="red">#</font>
					spaces. If no '#' is set, treats tabs as 4 spaces.</p>
				<p><font color="#000080" size="4"><strong>-T<font color="red">#</font></strong><font size="3"><font color="#000000">
								OR </font><font color="#000080"><strong>--force-indent=tab=<font color="red">#</font></strong></font><br>
							<font color="#000000">Indent using tab characters.</font><font color="#000000"> Treat 
								each tab as </font><font color="red">#</font><font color="#000000"> spaces. 
								Uses tabs as indents in areas '--indent=tab' prefers to use spaces, such as 
								inside multi-line statements.</font></font></font></p>
				<p><font color="#000080" size="4"><strong>-C</strong></font><font size="3"> OR</font><font color="#000080" size="4"><b>
							--</b></font><font color="#000080" size="3"><b>indent-classes</b></font><font size="2"><br>
					</font><font size="3">Indent 'class' blocks so that the headers 'public:', 
						'protected:' and 'private:' are indented in the class block.</font></p>
				<blockquote>
					<p><font color="#330000" size="3">The default:</font></p>
				</blockquote><blockquote>
					<p><font color="#800080" size="3"><b><tt>class Foo<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
									public:<br>
									&nbsp;&nbsp;&nbsp; Foo();<br>
									&nbsp;&nbsp;&nbsp; virtual ~Foo();<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt>;</tt></b></font></p>
					<p><font color="#330000" size="3">becomes:</font>
					</p>
					<p><font color="#800080" size="3"><b><tt>class Foo<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; public:<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Foo();<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; virtual ~Foo();<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font><font color="#800080" size="3"><b><tt>;</tt></b></font></p>
				</blockquote>
				<p><font color="#000080" size="4"><b>-S</b></font><font size="3"> OR</font><font color="#000080" size="4"><b>
							--</b></font><font color="#000080" size="3"><b>indent-switches</b></font><font size="2"><br>
					</font><font size="3">Indent 'switch' blocks so that the 'case XXX:' headers are 
						indented in the class block.</font></p>
				<blockquote>
					<p><font color="#330000" size="3">The default:</font></p>
				</blockquote><blockquote>
					<p><font color="#800080" size="3"><b><tt>switch (foo)<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>{</tt></b></font><font color="#800080" size="3"><b><tt><br>
									case 1:<br>
									&nbsp;&nbsp;&nbsp; a += 2;<br>
									&nbsp;&nbsp;&nbsp; break;<br>
									<br>
									default:<br>
									&nbsp;&nbsp;&nbsp; a += 2;<br>
									&nbsp;&nbsp;&nbsp; break;<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
					<p><font color="#330000" size="3">becomes:</font>
					</p>
					<p><font color="#800080" size="3"><b><tt>switch (foo)<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; case 1:<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; a += 2;<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
									<br>
									&nbsp;&nbsp;&nbsp; default:<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; a += 2;<br>
									&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
								</tt></b></font><font color="#ff0000" size="3"><b><tt>}</tt></b></font></p>
				</blockquote>

⌨️ 快捷键说明

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