Skip to content

Commit bf3bb14

Browse files
author
Admin
committed
Refactored entire script to use functions and common regexes.
Minor tweaks to the formatting.
1 parent 04a19b1 commit bf3bb14

File tree

3 files changed

+341
-247
lines changed

3 files changed

+341
-247
lines changed

SQL/sql2doxygen/Example/Example.sql

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ go
5959

6060
create table MyFinalTable
6161
(
62-
MyFinalColumn smalldatetime
62+
MyFinalColumn varchar(10)
6363
)
6464
go
6565

@@ -169,12 +169,13 @@ as
169169
go
170170

171171
/*!
172-
* A procedure that takes no arguments.
172+
* A procedure that takes arguments.
173173
*/
174174

175-
create procedure MyOneArgProcedure
175+
create procedure MyMultiArgProcedure
176176
(
177-
@anArgument varchar(10) --!< The procedures' sole argument
177+
@value1 tinyint, --!< The 1st argument.
178+
@value2 varchar(10) /*!< The 2nd argument. */
178179
)
179180
as
180181
set nocount on;

SQL/sql2doxygen/Example/Output.sql

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
struct MyTable
1919
{
2020
/** This column definition uses the C-style comment. */
21-
MyType MyColumn;
21+
myschema::MyType MyColumn;
2222
2323
/* Non-Doxygen C-style comment. */
2424
int CStyleComment;
@@ -54,7 +54,7 @@ struct MyOtherTable
5454
5555
struct MyFinalTable
5656
{
57-
smalldatetime MyFinalColumn;
57+
varchar[10] MyFinalColumn;
5858
};
5959
6060
/**
@@ -71,8 +71,7 @@ struct dbo::BracketsTable
7171
* NB: The signature is written on a single line.
7272
*/
7373
74-
varchar[10] MyNoArgsFunction()
75-
74+
varchar[10] MyNoArgsFunction()
7675
{
7776
return '42';
7877
}
@@ -81,10 +80,7 @@ varchar[10] MyNoArgsFunction()
8180
* A function that has a schema and []'s in the name.
8281
*/
8382

84-
BracketType dbo::BracketsFunction
85-
(
86-
)
87-
83+
BracketType dbo::BracketsFunction()
8884
{
8985
return '42';
9086
}
@@ -93,10 +89,7 @@ BracketType dbo::BracketsFunction
9389
* A function that takes no arguments and spans multiple lines.
9490
*/
9591

96-
varchar[20] MyOtherNoArgsFunction
97-
(
98-
)
99-
92+
varchar[20] MyOtherNoArgsFunction()
10093
{
10194
return '42';
10295
}
@@ -106,10 +99,7 @@ varchar[20] MyOtherNoArgsFunction
10699
* specified on a separate line.
107100
*/
108101

109-
varchar[20] OneMoreNoArgsFunction
110-
(
111-
)
112-
102+
varchar[20] OneMoreNoArgsFunction()
113103
{
114104
return '42';
115105
}
@@ -121,9 +111,8 @@ varchar[20] OneMoreNoArgsFunction
121111
varchar[10] MyFunction
122112
(
123113
tinyint @value1 //!< The 1st argument.
124-
, smalldatetime @value2 /*!< The 2nd argument. */
114+
,smalldatetime @value2 /*!< The 2nd argument. */
125115
)
126-
127116
{
128117
return
129118
case @value
@@ -155,12 +144,13 @@ void dbo::BracketsProcedure
155144
}
156145
157146
/*!
158-
* A procedure that takes no arguments.
147+
* A procedure that takes arguments.
159148
*/
160149
161-
void MyOneArgProcedure
150+
void MyMultiArgProcedure
162151
(
163-
varchar @anArgument //!< The procedures' sole argument
152+
tinyint @value1 //!< The 1st argument.
153+
,varchar[10] @value2 /*!< The 2nd argument. */
164154
)
165155
{
166156
set nocount on;

0 commit comments

Comments
 (0)