aboutsummaryrefslogtreecommitdiff
path: root/third_party/CppHeaderParser/CppHeaderParser/examples/SampleClass.h
blob: 628e50f8ec11e773fd4e78aa44a6948045fd8f6f (plain)
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
#include <vector>
#include <string>

typedef char* string;

using namespace std;
class SampleClass
{
public:
    SampleClass();
    /*!
     * Method 1
     */
    string meth1();

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

    /**
     * Method 3 description
     *
     * \param v1 Variable 1
     * \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};	// invalid c++, fixing parser anyways.

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

        void alphaMethod();

        string alphaString;
    };

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

            string omegaString;
        };
    };
}

// tests by hart //
namespace Gamma {
	typedef std::string mystring;
}
typedef std::string _StringBase;
typedef _StringBase String;

namespace Theta {
	class ThetaClass {
		public:
			ThetaClass();
			~ThetaClass();
		protected:
			struct mystruct {
				bool xxx;
			};
			void this_method_protected();
	}

	struct ThetaStruct {
		bool test1;
	};

	class ThetaClass2 {
		public:
			ThetaClass2();
			static inline void static_inlined_method();
			inline friend void myfriendmethod();
			static std::vector<float> returns_std_vector();
			float operator + ();
			template<typename AAA> std::vector<float> template_method( const AAA & aaa );

	}

	inline int ThetaClass::method_defined_outside() {
		return 1;
	}
	inline ThetaClass::operator ThetaClass() const
	{
		return ThetaClass();
	}


}

struct FreeStruct {
	bool freestructs_boolvar;
	float freestructs_floatvar;
};

namespace A {

	class FixMe {
		virtual ~__forced_unwind() throw();
		virtual void purevirt() = 0;
		int realMethod() {
			return 1
		}
	};	// legal to end class with }; ?

	class SubClassFixMe :  public FixMe {
		public:
			void purevirt();
	}

	namespace B {

	}
	class StillAbstract :  public FixMe {
		public:
			void somemethod();
			pointer operator->() const { return &(operator*()); }	// example of operator used in method def

	}

}
namespace C __attribute__ ((__visibility__ ("default"))) {
}