Astyle的styles
来源:互联网 发布:origin画图for mac 编辑:程序博客网 时间:2024/05/17 04:28
Style-格式配置:
最常用的就是ansi或或kr格式,实际上,kr,stroustrup和linux这三种格式是非常接近的了,试了好几个文件,只有非常微小的区别,可以忽略不计。
stype
选项
--style=allman
--style=ansi
--style=bsd
--style=break
-A1
--style=java
--style=attach
-A2
--style=kr
--style=k&r
--style=k/r
-A3
--style=stroustrup
-A4
--style=whitesmith
-A5
--style=banner
-A6
代码风格
int Foo()
{
if (isBar)
{
bar();
return 1;
}
else
{
return 0;
}
}
int Foo() {
if (isBar) {
bar();
return 1;
} else {
return 0;
}
}
int Foo()
{
if (isBar) {
bar();
return 1;
} else {
return 0;
}
}
int Foo()
{
if (isBar) {
bar();
return 1;
} else {
return 0;
}
}
int Foo()
{
if (isBar)
{
bar();
return 1;
}
else
{
return 0;
}
}
int Foo() {
if (isBar) {
bar();
return 1;
}
else {
return 0;
}
}
stype
选项
--style=gnu
-A7
--style=linux
-A8
--style=horstmann
-A9
--style=1tbs
-A10
--style=pico
-A11
--style=lisp
-A12
代码风格
int Foo()
{
if (isBar)
{
bar();
return 1;
}
else
{
return 0;
}
}
int Foo()
{
if (isBar) {
bar();
return 1;
} else {
return 0;
}
}
int Foo()
{ if (isBar)
{ bar();
return 1;
}
else
{ return 0;
}
}
int Foo()
{
if (isBar) {
bar();
return 1;
} else {
return 0;
}
}
int Foo()
{ if (isBar)
{ bar();
return 1; }
else
return 0; }
int Foo() {
if (isBar) {
bar();
return 1; }
else
return 0; }
其他常用的参数:
-C
类中public,pretected,private关键字,一个tab的缩进
-S
switch中case关键字,一个tab的缩进
-K
switch中case关键字,无缩进
-N
被namespace包含的block,一个tab的缩进
-w
格式化多行的宏定义
-c
将tab转化为对应个数的空格
--mode=c
格式化的是C/C++的源文件或者头文件(缺省值)
--mode=java
格式化的是JAVA的源文件
--suffix=####
将原始文件保存为“####”后缀,而不是“orig”
--suffix=none
不保存原始文件
--exclude=####
优化时不包含“####”文件或目录
-Z
修改后保持文件的修改时间不变
-X
将错误信息输出到标准输出设备(stdout),而不是标准错误设备(stderr)
-Q
只显示格式化前后发生变化的文件
-q
不输出任何信息
-z1
使用windows版本的回车符(CRLF)
-z2
使用linux版本的回车符(LF)
--help
显示帮助信息
-v
显示版本信息
- Astyle的styles
- Astyle的使用说明
- 我的astyle参数
- astyle
- astyle
- linux下astyle的使用
- AStyle 插件的经典使用
- styles
- styles
- Styles
- android中styles的使用
- Android的Styles和Themes
- 开启程序的Visual Styles
- artistic style (astyle) 的使用配置
- 我的vs(05,08)astyle设置
- git astyle对代码的格式化
- astyle进行源文件格式化的扩展
- 使用AStyle提升我们的代码可读性
- CDialog
- 八 多态
- 从零移植uboot 2017 到nuc970(第十九天)
- ns2相关学习——tcl脚本编写(1)
- C 语言实现队列
- Astyle的styles
- linux傻瓜式安装lnmp
- SSH 修改tomcat端口号
- Android使用AlertDialog的信息列表单选、多选对话框
- FireFox火狐浏览器设置不加载图片
- (14)YARN Timeline Server
- (四)主题应用
- 继承
- 最大公约数