File indexing completed on 2024-04-14 14:17:47

0001 
0002 #include "cpplib.h"
0003 
0004 #include "external_lib.h"
0005 
0006 MyObject::MyObject(QObject* parent)
0007   : QObject(parent)
0008 {
0009 
0010 }
0011 
0012 double MyObject::unnamedParameters(int i, double d)
0013 {
0014   return i * d;
0015 }
0016 
0017 int MyObject::addThree(int input) const
0018 {
0019   return input + 3;
0020 }
0021 
0022 QList<int> MyObject::addThree(QList<int> input) const
0023 {
0024   auto output = input;
0025   std::transform(output.begin(), output.end(),
0026       output.begin(),
0027       [](int in) { return in + 3; });
0028   return output;
0029 }
0030 
0031 const QString MyObject::addThree(const QString& input, const QString& prefix) const
0032 {
0033   return prefix + input + QStringLiteral("Three");
0034 }
0035 
0036 int MyObject::findNeedle(QStringList list, QString needle, Qt::MatchFlags flags) const
0037 {
0038   if (flags & Qt::MatchStartsWith) {
0039     auto it = std::find_if(list.begin(), list.end(), [needle](QString cand) {
0040       return cand.startsWith(needle);
0041     });
0042     if (it != list.end()) {
0043       return std::distance(list.begin(), it);
0044     }
0045     return -1;
0046   }
0047   return list.indexOf(needle);
0048 }
0049 
0050 int MyObject::qtEnumTest(QFlags<Qt::MatchFlag> flags)
0051 {
0052   return flags;
0053 }
0054 
0055 int MyObject::localEnumTest(QFlags<LocalEnum> flags)
0056 {
0057   return flags;
0058 }
0059 
0060 int MyObject::functionParam(std::function<int()> fn)
0061 {
0062   return fn();
0063 }
0064 
0065 int MyObject::groups(unsigned int maxCount) const
0066 {
0067   return maxCount;
0068 }
0069 
0070 int MyObject::externalFwdDecl(const ExternalFwdDecl& f)
0071 {
0072   return f.getValue();
0073 }
0074 
0075 int MyObject::externalFwdDeclRef(ExternalFwdDecl& f)
0076 {
0077   return f.getValue();
0078 }
0079 
0080 int MyObject::localDeclListDecl(const QList<LocalFwdDecl>& l)
0081 {
0082   return std::accumulate(l.begin(), l.end(), 0, [](int current, LocalFwdDecl const& next){
0083     return current + next.getValue();
0084   });
0085 }
0086 
0087 int MyObject::const_parameters(const int input, QObject* const obj) const
0088 {
0089   if (obj) return input / 3;
0090   return input / 2;
0091 }
0092 
0093 int MyObject::localFwdDecl(const LocalFwdDecl& f)
0094 {
0095   return f.getValue();
0096 }
0097 
0098 int MyObject::localListDecl(const QList<int>& l)
0099 {
0100   return std::accumulate(l.begin(), l.end(), 0);
0101 }
0102 
0103 void MyObject::enumNullptr(Qt::WindowFlags f)
0104 {
0105 
0106 }
0107 
0108 void MyObject::enumBraces(Qt::WindowFlags f)
0109 {
0110 
0111 }
0112 
0113 void MyObject::stringBraces(QString s)
0114 {
0115 
0116 }
0117 
0118 void MyObject::stringRefBraces(QString const& s)
0119 {
0120 
0121 }
0122 
0123 void MyObject::intBraces(int i)
0124 {
0125 
0126 }
0127 
0128 void MyObject::intRefBraces(int const& s)
0129 {
0130 
0131 }
0132 
0133 void MyObject::pointerBraces(int* p)
0134 {
0135 
0136 }
0137 
0138 LocalFwdDecl::LocalFwdDecl(int value)
0139   : m_value(value)
0140 {
0141 
0142 }
0143 
0144 int LocalFwdDecl::getValue() const
0145 {
0146   return m_value;
0147 }
0148 
0149 
0150 NonCopyable::NonCopyable()
0151   : mNum(new int(42))
0152 {
0153 
0154 }
0155 
0156 NonCopyable::~NonCopyable()
0157 {
0158   delete mNum;
0159 }
0160 
0161 NonCopyableByMacro::NonCopyableByMacro()
0162 {
0163 
0164 }
0165 
0166 namespace SomeNS {
0167 
0168 NonCopyableInNS::NonCopyableInNS()
0169   : mNum(new int(42))
0170 {
0171 
0172 }
0173 
0174 NonCopyableInNS::~NonCopyableInNS()
0175 {
0176   delete mNum;
0177 }
0178 
0179 }
0180 
0181 void MyObject::publicSlot1()
0182 {
0183   Q_EMIT publicSlotCalled();
0184 }
0185 
0186 void MyObject::publicSlot2()
0187 {
0188   Q_EMIT publicSlotCalled();
0189 }
0190 
0191 void MyObject::protectedSlot1()
0192 {
0193   Q_EMIT protectedSlotCalled();
0194 }
0195 
0196 void MyObject::protectedSlot2()
0197 {
0198   Q_EMIT protectedSlotCalled();
0199 }
0200 
0201 void MyObject::privateSlot1()
0202 {
0203   Q_EMIT privateSlotCalled();
0204 }
0205 
0206 void MyObject::privateSlot2()
0207 {
0208   Q_EMIT privateSlotCalled();
0209 }
0210 
0211 qreal SomeNS::useEnum(MyFlags flags)
0212 {
0213   return flags;
0214 }
0215 
0216 int customMethod(QList<int> const& nums)
0217 {
0218   return nums.size();
0219 }
0220 
0221 int SomeNS::customMethod(QList<int> const& nums)
0222 {
0223   return 0;
0224 }
0225 
0226 int anotherCustomMethod(QList<int> const& nums)
0227 {
0228   return 0;
0229 }
0230 
0231 void TypedefUser::setTagPattern(const QString &tagName,
0232                    SomeNS::TagFormatter formatter,
0233                    int leadingNewlines)
0234 {
0235 
0236 }
0237 
0238 Shared::Shared(const Shared& other)
0239 {
0240 
0241 }