Skip to content

Commit 7776526

Browse files
author
Admin
committed
Initial version.
1 parent 2d6d4dc commit 7776526

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

Example/Output.sql

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
/**
2+
** \file
3+
** \brief The examples of what sql2doxygen can cope with.
4+
** \author Chris Oldwood
5+
**
6+
** This file contains various SQL object definitions and comment styles to show
7+
** what sql2doxygen can transform.
8+
**/
9+
10+
// The code below will be stripped by the filter as it's not an object definition.
11+
// However this comment will remain. But it's not a Doxygen format comment so
12+
// won't have any effect on the documentation generated.
13+
14+
/**
15+
** This table definition uses the C-style comment.
16+
**/
17+
18+
struct MyTable
19+
{
20+
/** This column definition uses the C-style comment. */
21+
MyType MyColumn;
22+
23+
/* Non-Doxygen C-style comment. */
24+
int CStyleComment;
25+
26+
// Non-Doxygen SQL-style comment
27+
int SqlStyleComment;
28+
29+
//! This column uses the SQL-equivalent Doxygen comment
30+
int SqlStyleDoxComment;
31+
32+
/// This column uses the other SQL-equivalent Doxygen comment
33+
int SqlStyleDoxComment2;
34+
35+
smallint CommentOnRight; /*!< This comment is to the right */
36+
37+
bigint CommentOnRight2; //!< This comment is also to the right
38+
39+
float CommentOnRight3; ///< Another comment to the right
40+
};
41+
42+
////////////////////////////////////////////////////////////////////////////////
43+
/// This table definition uses the SQL-equivalent block comment style.
44+
////////////////////////////////////////////////////////////////////////////////
45+
46+
struct MyOtherTable
47+
{
48+
smalldatetime MyColumn;
49+
};
50+
51+
//!
52+
//! The final table definition uses the other SQL-equivalent block comment style.
53+
//!
54+
55+
struct MyFinalTable
56+
{
57+
smalldatetime MyFinalColumn;
58+
};
59+
60+
/*!
61+
* A function that takes no arguments.
62+
* NB: The signature is written on a single line.
63+
*/
64+
65+
varchar[10] MyNoArgsFunction()
66+
67+
{
68+
return '42';
69+
}
70+
71+
/*!
72+
* A function that takes no arguments and spans multiple lines.
73+
*/
74+
75+
varchar[20] MyOtherNoArgsFunction
76+
(
77+
)
78+
79+
{
80+
return '42';
81+
}
82+
83+
/*!
84+
* A function that takes no arguments where the return is
85+
* specified on a separate line.
86+
*/
87+
88+
varchar[20] OneMoreNoArgsFunction
89+
(
90+
)
91+
92+
{
93+
return '42';
94+
}
95+
96+
/*!
97+
* A function that takes one or more arguments.
98+
*/
99+
100+
varchar[10] MyFunction
101+
(
102+
tinyint @value1 //!< The 1st argument.
103+
, smalldatetime @value2 /*!< The 2nd argument. */
104+
)
105+
106+
{
107+
return
108+
case @value
109+
when 4 then '4'
110+
when 2 then '2'
111+
else '42'
112+
end
113+
}
114+
115+
/*!
116+
* A procedure that takes no arguments.
117+
*/
118+
119+
void MyNoArgProcedure()
120+
{
121+
set nocount on;
122+
}
123+
124+
/*!
125+
* A procedure that takes no arguments.
126+
*/
127+
128+
void MyOneArgProcedure
129+
(
130+
varchar @anArgument //!< The procedures' sole argument
131+
)
132+
{
133+
set nocount on;
134+
}

0 commit comments

Comments
 (0)