Source

cppheaderparser / CppHeaderParser / test / TestSampleClass.h

Full commit
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
#include <vector>
#include <string>
using namespace std;
class SampleClass: public BaseSampleClass
{
public:
	enum Elephant
	{
		EL_ONE = 1,
		EL_TWO = 2,
		EL_NINE = 9,
		EL_TEN,
	};

    SampleClass();
    /*!
     * Method 1
     */
    string meth1();

    ///
    /// Method 2 description
    ///
    /// @param v1 Variable 1
    ///
    int meth2(int v1);

    /**
     * Method 3 description
     *
     * \param v1 Variable 1 with a really long
     * wrapping description
     * \param v2 Variable 2
     */
    void meth3(const string & v1, vector<string> & v2);

    /**********************************
     * Method 4 description
     *
     * @return Return value
     *********************************/
    unsigned int meth4();
private:
    void * meth5(){return NULL;}

    /// prop1 description
    string prop1;
    //! prop5 description
    int prop5;
};
namespace Alpha
{
    class AlphaClass
    {
    public:
    	AlphaClass();

    	void alphaMethod();

    	string alphaString;
    protected:
    	typedef enum
    	{
    		Z_A,
    		Z_B = 0x2B,
    		Z_C = 'j',
			Z_D,
    	} Zebra;
    };

    namespace Omega
    {
		class OmegaClass
		{
		public:
			OmegaClass();

			string omegaString;
		protected:
			///
			/// @brief Rino Numbers, not that that means anything
			///
			typedef enum
			{
				RI_ZERO,
				RI_ONE,
				RI_TWO
			} Rino;
		};
    };
}

//Sample class for bug 3488053
class Bug_3488053
{
	public:
	class Bug_3488053_Nested
	{
	public:
		int x;
	};
};

// Bug 3488360
namespace Citrus
{
  class BloodOrange { };
}

class Bananna: public Citrus::BloodOrange
{
};

class ExcellentCake: private Citrus::BloodOrange, Convoluted::Nested::Mixin
{
};

// Bug 3487551
class Bug_3487551
{
public:
    virtual int method();
};


// Feature Request 3488051
struct SampleStruct
{
    unsigned int meth();
private:
    int prop;
};

// Bug 3488049 & Feature Request 3488050
const int MAX_ITEM = 7;
class Bird
{
int items[MAX_ITEM];
int otherItems[7];
int oneItem;
};

// Bug 3488054
class Monkey {
private:
static void Create();
};
inline void Monkey::Create() { }

// Bug 3488275
class Chicken
{
template <typename T> static T Get();
};
template <typename T> T Chicken::Get() { return T(); }

// Bug 3491240
class Lizzard {
Lizzard();
explicit Lizzard( int a );
};

// Bug 3491178
class Owl {
private:
template <typename T> int* tFunc( int count );
};

template <typename T> int* Owl::tFunc( int count ) {
if (count == 0) {
return NULL;
}
return NULL;
}

// Bug 3491232
class GrapeClass {
private:
struct GrapeStruct { };
int x;
void f();
};


// Bug 3491319
struct AnonHolderClass {
struct {
int x;
} a;
};


// Feature Request 3491220
class CowClass {};
struct CowStruct {};

// Bug 3491334
class BaseMangoClass { };
class MangoClass: virtual public BaseMangoClass { };

// Bug 3492237
const long MAX_LEN = 7;
class EagleClass {
int a[(int)MAX_LEN];
};

// Bug 3497164
class FrogClass {

    struct {
        int a;
    } x;

    struct {
        int b;
    } y;

    struct {
        int c;
    } z;

};

// Bug 3497160
class DogClass;
class CatClass {
    friend DogClass;
};

// Bug 3497155
extern "C" {
int FishA( const char* strA );
int FishB( const char* strB );
}

// Bug 3497168
class PandaClass {
static const int CONST_A = (1 << 7) - 1;
static const int CONST_B = sizeof(int);
};

// Bug 3497166
class PotatoClass {
    struct FwdStruct;
    FwdStruct* ptr;
    struct FwdStruct {
    	int a;
    };
};

// Bug 3497162
class HogClass {
	union HogUnion {
		int a;
		float b;
	} u;
};

// Bug 3497158
class CherryClass {
	template< int ID >
public:
	void CherryClass ();
	struct NestStruct {
	    void FuncA();
	    int val;
	};
};

// Bug 3517308
template<class T>
class GarlicClass
{
public:
	GarlicClass();
    int fun1(T);
    int fun2(T);
};

// Bug 3514728
class CarrotClass
{
int var1;
#define FIRSTLINE \
SECONDLINE
void fun1();
};

// Bug 3517289
extern "C" void f(int i, char c, float x);

extern "C" {
	int fun1(SP1, SP2);
	int fun2(SP1, SP2);

	class ExternClass
	{
		ExternClass();
	}
};

// Bug 3514671
struct OliveStruct{
	struct other* a;
	void* b;
	boolean c;
	int d;
};

// Bug 3515330
namespace RoosterNamespace
{
    class RoosterOuterClass
    {
    public:
        int member1;

        class RoosterSubClass1
        {
        public:
            int publicMember1;
        private:
            int privateMember1;
        };

    private:
        int member2;
        class RoosterSubClass2
        {
        public:
            int publicMember2;
        private:
            int privateMember2;
        };
    };
}


// Bug 3514672
class OperatorClass
{
public:
    void operator= (const Sample25Class&);
    void operator-= (const Sample25Class&);
    void operator+=();
    void operator[]();
    bool operator == (const int &b);
    operator+();
    void operator-();
    void operator*();
    void operator\();
    void operator%();
    void operator^();
    void operator|();
    void operator&();
    void operator~();
    void operator<<();
    void operator>>();
    void operator!=();
    void operator<();
    void operator>();
    void operator>=();
    void operator<=();
    void operator!();
    void operator&&();
    void operator||();
    void operator+=();
    void operator-=();
    void operator*=();
    void operator\=();
    void operator%=();
    void operator&=();
    void operator|=();
    void operator^=();
    void operator<<=();
    void operator>>=();
    void operator++();
    void operator--();
    void operator()();
    void operator->();
    void operator,();
};

// Feature request 3519502 & 3523010
class CrowClass
{
public:
    int meth();

public slots:
    void testSlot(int i);
};

// Bug 3497170
struct DriverFuncs {
    void* (*init) ();
    void (*write) (void *buf, int buflen);
};

// Bug 3519178
template<class T> SnailTemplateClass
{
};

namespace SnailNamespace2
{
    class SnailClass
    {
    };
}

class Snail2Class
{
public:
    SnailNamespace::SnailClass meth(tr1::shared_ptr<SnailTemplateClass<SnailNamespace::SnailClass> >);
};

// Feature Request 3523198
class QualeClass : public QObject
{
    Q_OBJECT
    void func();
};

// Feature Request 3523235
class RockClass
{
    int getNum() const;
    int getNum2();
};

// Bug 3523196
class AlmondClass
{
public:
    std::map<unsigned, std::pair<unsigned, SnailTemplateClass<SnailNamespace::SnailClass> > > meth(bool flag,
            std::map<unsigned, std::pair<unsigned, SnailTemplateClass<SnailNamespace::SnailClass> > > bigArg);
};

// Bug 3524327
class StoneClass
{
    virtual int getNum2() const = 0;
    int getNum3();
};

// Bug 3531219
class Kangaroo
{
public:
    Kangaroo() {
    }
    class Joey
    {
    public:
        Joey();
    };
};


// Bug 3535465
class Ant
{
public:
    Ant(uint index, const FiniteElement& element, const ufc::cell& cell)
      : index(index), element(element), cell(cell) {}

	Ant(MeshEntity& entity) : MeshEntity(entity.mesh(), 1, entity.index())
	{}
};

// Bug 3536069
template <typename Plant> struct Onion<Red,Plant>
{
    int i;
};

template <typename Plant> struct Onion<Sweet,Plant>
{
    int i;
};

// Bug 3536067
class BlueJay : public Bird, public virtual Food
{
public:
    BlueJay() {}
};

// Bug 3536071
class Pea : public Vegetable<Green>
{
	int i;
}


// Bug 3567172
class Pear
{
	enum Stem stem_property;
}

// Bug 3567854 and 3568241
struct Beans
{
    UINT16 hdr;
    union
    {
        UINT16 typeA;
        UINT16 typeB;
        UINT16 raw[3];
    };
    UINT32 data[204];
    union
    {
        UINT16 typeC;
        UINT16 typeD;
        UINT16 raw[3];
    };
};

// Bug 3568629
void termite(void)
{
    return ((structA*) (Func())->element);
}

// Bug 3569622
class Japyx
{
public:
    enum enum1
    {
        e1, // 00
        e2, // 01
    };
    UINT32 a;
};

void japyxFunc(struct s1 *pS, Japyx::enum1 x, MYTYPE myVar);

// Bug 3570105
enum Author
{
    NAME = ('J' << 24 | \
    'A' << 16 | \
    'S' << 8 | \
    'H'),
};