Tools and libraries to glue C/C++ APIs to high-level languages
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

145 lines
2.3 KiB

#include "../Tests.h"
class DLL_API Foo
{
public:
Foo();
int method();
int operator[](int i) const;
int operator[](unsigned int i);
int& operator[](int i);
int A;
protected:
int P;
};
class DLL_API Qux
{
public:
Qux();
Qux(Foo foo);
int farAwayFunc() const;
int array[3];
void obsolete();
};
class DLL_API Bar : public Qux
{
public:
int method();
const Foo& operator[](int i) const;
Foo& operator[](int i);
Bar operator*();
const Bar& operator*(int m);
const Bar& operator++();
Bar operator++(int i);
void* arrayOfPrimitivePointers[1];
private:
int index;
Foo m_foo;
};
class DLL_API Baz : public Foo, public Bar
{
public:
int takesQux(const Qux& qux);
Qux returnQux();
typedef bool (*FunctionTypedef)(const void *);
FunctionTypedef functionTypedef;
};
struct QArrayData
{
};
typedef QArrayData QByteArrayData;
struct QByteArrayDataPtr
{
QByteArrayData* ptr;
};
class DLL_API AbstractProprietor
{
public:
virtual int getValue();
virtual void setValue(int value) = 0;
virtual long prop() = 0;
virtual void setProp(long prop);
virtual int parent();
protected:
int m_value;
long m_property;
};
class DLL_API Proprietor : public AbstractProprietor
{
public:
virtual void setValue(int value);
virtual long prop();
};
template <typename T>
class QFlags
{
public:
QFlags() {}
};
class DLL_API ComplexType
{
public:
int check();
QFlags<int> returnsQFlags();
void takesQFlags(const QFlags<int> f);
};
class DLL_API P : Proprietor
{
public:
P(const Qux& qux);
P(Qux* qux);
virtual void setValue(int value);
virtual long prop();
ComplexType complexType();
void setComplexType(const ComplexType& value);
virtual void parent(int i);
bool isTest();
void setTest(bool value);
bool isBool();
void setIsBool(bool value);
private:
ComplexType m_complexType;
};
// Tests destructors
struct DLL_API TestDestructors
{
static int Marker;
TestDestructors() { Marker = 0xf00d; }
~TestDestructors() { Marker = 0xcafe; }
};
class DLL_API TestCopyConstructorVal
{
public:
TestCopyConstructorVal();
TestCopyConstructorVal(const TestCopyConstructorVal& other);
int A;
float B;
};