mxml/test/struct.cxx
Michael R Sweet c00d7f55a2 Fix C++ class/struct handling.
Move and separate test files for mxmldoc.
2004-05-01 04:30:43 +00:00

49 lines
759 B
C++

typedef struct foo_s /* Foo structure */
{
float foo; /* Real number */
int bar; /* Integer */
foo_s(float f, int b);
~foo_s();
// 'get_bar()' - Get the value of bar.
int // O - Value of bar
get_bar()
{
return (bar);
}
// 'get_foo()' - Get the value of foo.
float // O - Value of foo
get_foo()
{
return (foo);
}
// 'set_bar()' - Set the value of bar.
void
set_bar(int b) // I - Value of bar
{
bar = b;
}
// 'set_foo()' - Set the value of foo.
void
set_foo(float f) // I - Value of foo
{
foo = f;
}
} foo_t;
// 'foo_s::foo_s()' - Create a foo_s structure.
foo_s::foo_s(float f, int b)
{
foo = f;
bar = b;
}
// 'foo_s::~foo_s()' - Destroy a foo_s structure.
foo_s::~foo_s()
{
}