summaryrefslogtreecommitdiffstats
path: root/src/memberdef.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/memberdef.cpp')
-rw-r--r--src/memberdef.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index afdcab6..5b58626 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -1653,6 +1653,8 @@ MemberDef *MemberDef::createTemplateInstanceMember(
bool MemberDef::hasOneLineInitializer() const
{
+ //printf("%s: init=%s, initLines=%d maxInitLines=%d userInitLines=%d\n",
+ // name().data(),init.data(),initLines,maxInitLines,userInitLines);
return !init.isEmpty() && initLines==0 && // one line initializer
((maxInitLines>0 && userInitLines==-1) || userInitLines>0); // enabled by default or explicitly
}
@@ -1664,3 +1666,12 @@ bool MemberDef::hasMultiLineInitializer() const
|| initLines<userInitLines // explicitly enabled
);
}
+
+void MemberDef::setInitializer(const char *initializer)
+{
+ init=initializer;
+ int p=init.length()-1;
+ while (p>=0 && isspace(init.at(p))) p--;
+ init=init.left(p+1);
+ initLines=init.contains('\n');
+}