Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pistache
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
pistache
Commits
14bafd53
Commit
14bafd53
authored
Jan 12, 2020
by
Dennis Jenkins
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More cppcheck fixes.
parent
40a99228
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
include/pistache/description.h
include/pistache/description.h
+2
-2
src/common/description.cc
src/common/description.cc
+14
-14
No files found.
include/pistache/description.h
View file @
14bafd53
...
...
@@ -370,10 +370,10 @@ private:
struct
SubPath
{
SubPath
(
std
::
string
prefix
,
PathGroup
*
paths
);
PathBuilder
route
(
std
::
string
name
,
Http
::
Method
method
,
std
::
string
description
=
""
);
PathBuilder
route
(
const
std
::
string
&
name
,
Http
::
Method
method
,
std
::
string
description
=
""
);
PathBuilder
route
(
PathDecl
fragment
,
std
::
string
description
=
""
);
SubPath
path
(
std
::
string
prefix
);
SubPath
path
(
const
std
::
string
&
prefix
);
template
<
typename
T
>
void
parameter
(
std
::
string
name
,
std
::
string
description
)
{
...
...
src/common/description.cc
View file @
14bafd53
...
...
@@ -203,7 +203,7 @@ SubPath::SubPath(
{
}
PathBuilder
SubPath
::
route
(
std
::
string
name
,
Http
::
Method
method
,
std
::
string
description
)
{
SubPath
::
route
(
const
std
::
string
&
name
,
Http
::
Method
method
,
std
::
string
description
)
{
auto
fullPath
=
prefix
+
name
;
Path
path
(
std
::
move
(
fullPath
),
method
,
std
::
move
(
description
));
std
::
copy
(
std
::
begin
(
parameters
),
std
::
end
(
parameters
),
std
::
back_inserter
(
path
.
parameters
));
...
...
@@ -219,7 +219,7 @@ SubPath::route(PathDecl fragment, std::string description) {
}
SubPath
SubPath
::
path
(
std
::
string
prefix
)
{
SubPath
::
path
(
const
std
::
string
&
prefix
)
{
return
SubPath
(
this
->
prefix
+
prefix
,
paths
);
}
...
...
@@ -397,7 +397,7 @@ Swagger::install(Rest::Router& router) {
*/
struct
Path
{
Path
(
const
std
::
string
&
value
)
explicit
Path
(
const
std
::
string
&
value
)
:
value
(
value
)
,
trailingSlashValue
(
value
)
{
...
...
@@ -406,32 +406,32 @@ Swagger::install(Rest::Router& router) {
}
static
bool
hasTrailingSlash
(
const
Rest
::
Request
&
req
)
{
auto
res
=
req
.
resource
();
return
res
.
back
()
==
'/'
;
auto
res
_
=
req
.
resource
();
return
res
_
.
back
()
==
'/'
;
}
std
::
string
stripPrefix
(
const
Rest
::
Request
&
req
)
{
auto
res
=
req
.
resource
();
if
(
!
res
.
compare
(
0
,
value
.
size
(),
value
))
{
return
res
.
substr
(
value
.
size
());
auto
res
_
=
req
.
resource
();
if
(
!
res
_
.
compare
(
0
,
value
.
size
(),
value
))
{
return
res
_
.
substr
(
value
.
size
());
}
return
res
;
return
res
_
;
}
bool
matches
(
const
Rest
::
Request
&
req
)
const
{
auto
res
=
req
.
resource
();
if
(
value
==
res
)
auto
res
_
=
req
.
resource
();
if
(
value
==
res
_
)
return
true
;
if
(
res
==
trailingSlashValue
)
if
(
res
_
==
trailingSlashValue
)
return
true
;
return
false
;
}
bool
isPrefix
(
const
Rest
::
Request
&
req
)
{
auto
res
=
req
.
resource
();
return
!
res
.
compare
(
0
,
value
.
size
(),
value
);
auto
res
_
=
req
.
resource
();
return
!
res
_
.
compare
(
0
,
value
.
size
(),
value
);
}
const
std
::
string
&
withTrailingSlash
()
const
{
...
...
Write
Preview
Markdown
is supported
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