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
988a6f7c
Unverified
Commit
988a6f7c
authored
Aug 24, 2018
by
Dennis Jenkins
Committed by
GitHub
Aug 24, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #272 from knowledge4igor/improve_string_usage
Improve string usage in code
parents
60fbaa25
a7d11eaf
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
6 deletions
+13
-6
include/pistache/client.h
include/pistache/client.h
+2
-1
include/pistache/router.h
include/pistache/router.h
+2
-2
src/client/client.cc
src/client/client.cc
+7
-1
src/server/router.cc
src/server/router.cc
+2
-2
No files found.
include/pistache/client.h
View file @
988a6f7c
...
@@ -271,7 +271,8 @@ public:
...
@@ -271,7 +271,8 @@ public:
}
}
RequestBuilder
&
cookie
(
const
Cookie
&
cookie
);
RequestBuilder
&
cookie
(
const
Cookie
&
cookie
);
RequestBuilder
&
body
(
std
::
string
val
);
RequestBuilder
&
body
(
const
std
::
string
&
val
);
RequestBuilder
&
body
(
std
::
string
&&
val
);
RequestBuilder
&
timeout
(
std
::
chrono
::
milliseconds
value
);
RequestBuilder
&
timeout
(
std
::
chrono
::
milliseconds
value
);
...
...
include/pistache/router.h
View file @
988a6f7c
...
@@ -190,8 +190,8 @@ public:
...
@@ -190,8 +190,8 @@ public:
friend
class
FragmentTreeNode
;
friend
class
FragmentTreeNode
;
friend
class
Router
;
friend
class
Router
;
bool
hasParam
(
std
::
string
name
)
const
;
bool
hasParam
(
const
std
::
string
&
name
)
const
;
TypedParam
param
(
std
::
string
name
)
const
;
TypedParam
param
(
const
std
::
string
&
name
)
const
;
TypedParam
splatAt
(
size_t
index
)
const
;
TypedParam
splatAt
(
size_t
index
)
const
;
std
::
vector
<
TypedParam
>
splat
()
const
;
std
::
vector
<
TypedParam
>
splat
()
const
;
...
...
src/client/client.cc
View file @
988a6f7c
...
@@ -734,7 +734,13 @@ RequestBuilder::cookie(const Cookie& cookie) {
...
@@ -734,7 +734,13 @@ RequestBuilder::cookie(const Cookie& cookie) {
}
}
RequestBuilder
&
RequestBuilder
&
RequestBuilder
::
body
(
std
::
string
val
)
{
RequestBuilder
::
body
(
const
std
::
string
&
val
)
{
request_
.
body_
=
val
;
return
*
this
;
}
RequestBuilder
&
RequestBuilder
::
body
(
std
::
string
&&
val
)
{
request_
.
body_
=
std
::
move
(
val
);
request_
.
body_
=
std
::
move
(
val
);
return
*
this
;
return
*
this
;
}
}
...
...
src/server/router.cc
View file @
988a6f7c
...
@@ -23,7 +23,7 @@ Request::Request(
...
@@ -23,7 +23,7 @@ Request::Request(
}
}
bool
bool
Request
::
hasParam
(
std
::
string
name
)
const
{
Request
::
hasParam
(
const
std
::
string
&
name
)
const
{
auto
it
=
std
::
find_if
(
params_
.
begin
(),
params_
.
end
(),
[
&
](
const
TypedParam
&
param
)
{
auto
it
=
std
::
find_if
(
params_
.
begin
(),
params_
.
end
(),
[
&
](
const
TypedParam
&
param
)
{
return
param
.
name
()
==
std
::
string_view
(
name
.
data
(),
name
.
length
());
return
param
.
name
()
==
std
::
string_view
(
name
.
data
(),
name
.
length
());
});
});
...
@@ -32,7 +32,7 @@ Request::hasParam(std::string name) const {
...
@@ -32,7 +32,7 @@ Request::hasParam(std::string name) const {
}
}
TypedParam
TypedParam
Request
::
param
(
std
::
string
name
)
const
{
Request
::
param
(
const
std
::
string
&
name
)
const
{
auto
it
=
std
::
find_if
(
params_
.
begin
(),
params_
.
end
(),
[
&
](
const
TypedParam
&
param
)
{
auto
it
=
std
::
find_if
(
params_
.
begin
(),
params_
.
end
(),
[
&
](
const
TypedParam
&
param
)
{
return
param
.
name
()
==
std
::
string_view
(
name
.
data
(),
name
.
length
());
return
param
.
name
()
==
std
::
string_view
(
name
.
data
(),
name
.
length
());
});
});
...
...
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