Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.extension
Commits
b4b2d345
Commit
b4b2d345
authored
Apr 15, 2014
by
Manuel Günther
Browse files
Enabled special characters like '[' in parameter documentation, e.g., to indicate optional values.
parent
fc3ee8a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
xbob/extension/include/xbob.extension/documentation.h
View file @
b4b2d345
...
...
@@ -268,10 +268,10 @@ namespace xbob{
#ifndef XBOB_SHORT_DOCSTRINGS
// removes leading and trailing spaces
static
std
::
string
_strip
(
const
std
::
string
&
str
,
c
har
sep
=
' '
){
static
std
::
string
_strip
(
const
std
::
string
&
str
,
c
onst
std
::
string
&
sep
=
" []()|"
){
unsigned
first
=
0
,
last
=
str
.
size
();
while
(
first
<
str
.
size
()
&&
s
tr
[
first
]
==
sep
)
++
first
;
while
(
last
>
0
&&
str
[
last
-
1
]
==
sep
)
--
last
;
while
(
first
<
str
.
size
()
&&
s
ep
.
find
(
str
[
first
])
!=
std
::
string
::
npos
)
++
first
;
while
(
last
>
0
&&
sep
.
find
(
str
[
last
-
1
]
)
!=
std
::
string
::
npos
)
--
last
;
return
str
.
substr
(
first
,
last
-
first
);
}
...
...
@@ -433,7 +433,10 @@ inline xbob::extension::FunctionDoc& xbob::extension::FunctionDoc::add_prototype
){
#ifndef XBOB_SHORT_DOCSTRINGS
prototype_variables
.
push_back
(
variables
);
prototype_returns
.
push_back
(
return_values
);
if
(
!
return_values
)
prototype_returns
.
push_back
(
""
);
else
prototype_returns
.
push_back
(
return_values
);
#endif // XBOB_SHORT_DOCSTRINGS
return
*
this
;
}
...
...
@@ -524,8 +527,7 @@ inline const char* const xbob::extension::FunctionDoc::doc(
#endif // XBOB_SHORT_DOCSTRINGS
}
inline
void
xbob
::
extension
::
FunctionDoc
::
print_usage
(
)
const
inline
void
xbob
::
extension
::
FunctionDoc
::
print_usage
()
const
{
#ifdef XBOB_SHORT_DOCSTRINGS
return
function_description
.
c_str
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment