格式化初始化列表与功能参数列表不同

时间:2013-03-09 18:18:29

标签: uncrustify

我有一个C ++类构造器

Status::Status(QObject *parent) : QObject(parent)
    , m_currentPage(Status::UndefinedPage)
    , m_lastPage(Status::UndefinedPage) ,
    m_currentSubPage(Status::UndefinedSubPage), m_lastSubPage(Status::UndefinedSubPage)
    , m_ptr(0)
{
}

并希望看到它像这样

Status::Status(QObject *parent) 
    : QObject(parent)
    , m_currentPage(Status::UndefinedPage)
    , m_lastPage(Status::UndefinedPage)
    , m_currentSubPage(Status::UndefinedSubPage)
    , m_lastSubPage(Status::UndefinedSubPage)
    , m_ptr(0)
{
}

我找到了相关选项:

nl_class_colon                           = remove
nl_class_init_args                       = remove
pos_comma                                = lead_force
pos_class_comma                          = lead_force
pos_class_colon                          = lead_force

但这也会影响我不想要的正常功能参数。一旦我改变pos_comma,我的所有成员初始化列表就会变得拥挤。

如何定义与函数参数列表不同的构造函数初始化列表的外观?

感谢。

编辑:我希望函数参数列表看起来像

int r = myFuntion("a", "b",
                  "c");

1 个答案:

答案 0 :(得分:0)

不,从Uncrustify 0.60开始,这是不可能的。您必须坚持使用不同的风格或寻找另一种格式化程序。您还可以提交功能请求。

相关问题