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
7a5c4f44
Unverified
Commit
7a5c4f44
authored
Oct 19, 2018
by
Dennis Jenkins
Committed by
GitHub
Oct 19, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #325 from oktal/dennisjenkins75-warning-redux
Compiler warning reduction
parents
089b71b2
ea24b955
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
73 additions
and
13 deletions
+73
-13
examples/rest_description.cc
examples/rest_description.cc
+4
-4
include/pistache/async.h
include/pistache/async.h
+4
-0
include/pistache/client.h
include/pistache/client.h
+16
-2
include/pistache/description.h
include/pistache/description.h
+17
-1
include/pistache/mailbox.h
include/pistache/mailbox.h
+2
-0
include/pistache/router.h
include/pistache/router.h
+6
-0
include/pistache/stream.h
include/pistache/stream.h
+2
-0
include/pistache/view.h
include/pistache/view.h
+4
-2
src/common/cookie.cc
src/common/cookie.cc
+1
-1
src/common/description.cc
src/common/description.cc
+17
-3
No files found.
examples/rest_description.cc
View file @
7a5c4f44
...
...
@@ -115,19 +115,19 @@ private:
}
void
retrieveAllAccounts
(
const
Rest
::
Request
&
req
,
Http
::
ResponseWriter
response
)
{
void
retrieveAllAccounts
(
const
Rest
::
Request
&
,
Http
::
ResponseWriter
response
)
{
response
.
send
(
Http
::
Code
::
Ok
,
"No Account"
);
}
void
retrieveAccount
(
const
Rest
::
Request
&
req
,
Http
::
ResponseWriter
response
)
{
void
retrieveAccount
(
const
Rest
::
Request
&
,
Http
::
ResponseWriter
response
)
{
response
.
send
(
Http
::
Code
::
Ok
,
"The bank is closed, come back later"
);
}
void
createAccount
(
const
Rest
::
Request
&
req
,
Http
::
ResponseWriter
response
)
{
void
createAccount
(
const
Rest
::
Request
&
,
Http
::
ResponseWriter
response
)
{
response
.
send
(
Http
::
Code
::
Ok
,
"The bank is closed, come back later"
);
}
void
creditAccount
(
const
Rest
::
Request
&
req
,
Http
::
ResponseWriter
response
)
{
void
creditAccount
(
const
Rest
::
Request
&
,
Http
::
ResponseWriter
response
)
{
response
.
send
(
Http
::
Code
::
Ok
,
"The bank is closed, come back later"
);
}
...
...
include/pistache/async.h
View file @
7a5c4f44
...
...
@@ -171,6 +171,9 @@ namespace Async {
struct
Core
{
Core
(
State
_state
,
TypeId
_id
)
:
state
(
_state
)
,
exc
()
,
mtx
()
,
requests
()
,
id
(
_id
)
{
}
...
...
@@ -217,6 +220,7 @@ namespace Async {
struct
CoreT
:
public
Core
{
CoreT
()
:
Core
(
State
::
Pending
,
TypeId
::
of
<
T
>
())
,
storage
()
{
}
template
<
class
Other
>
...
...
include/pistache/client.h
View file @
7a5c4f44
...
...
@@ -165,8 +165,21 @@ public:
PROTOTYPE_OF
(
Aio
::
Handler
,
Transport
)
Transport
()
{}
Transport
(
const
Transport
&
rhs
)
{
UNUSED
(
rhs
);
}
Transport
()
:
requestsQueue
()
,
connectionsQueue
()
,
connections
()
,
requests
()
,
timeouts
()
{
}
Transport
(
const
Transport
&
)
:
requestsQueue
()
,
connectionsQueue
()
,
connections
()
,
requests
()
,
timeouts
()
{
}
typedef
std
::
function
<
void
()
>
OnResponseParsed
;
...
...
@@ -284,6 +297,7 @@ public:
private:
RequestBuilder
(
Client
*
const
client
)
:
client_
(
client
)
,
request_
()
,
timeout_
(
std
::
chrono
::
milliseconds
(
0
))
{
}
...
...
include/pistache/description.h
View file @
7a5c4f44
...
...
@@ -103,6 +103,10 @@ template<typename DT> struct DataTypeValidation {
}
// namespace Traits
struct
ProduceConsume
{
ProduceConsume
()
:
produce
()
,
consume
()
{
}
std
::
vector
<
Http
::
Mime
::
MediaType
>
produce
;
std
::
vector
<
Http
::
Mime
::
MediaType
>
consume
;
...
...
@@ -152,6 +156,8 @@ struct DataType {
virtual
const
char
*
format
()
const
=
0
;
virtual
bool
validate
(
const
std
::
string
&
input
)
const
=
0
;
virtual
~
DataType
()
{}
};
template
<
typename
T
>
...
...
@@ -160,6 +166,8 @@ struct DataTypeT : public DataType {
const
char
*
format
()
const
{
return
Traits
::
DataTypeInfo
<
T
>::
format
();
}
bool
validate
(
const
std
::
string
&
input
)
const
{
return
Traits
::
DataTypeValidation
<
T
>::
validate
(
input
);
}
virtual
~
DataTypeT
()
{}
};
template
<
typename
T
>
...
...
@@ -255,6 +263,10 @@ public:
bool
hasPath
(
const
std
::
string
&
name
,
Http
::
Method
method
)
const
;
bool
hasPath
(
const
Path
&
path
)
const
;
PathGroup
()
:
groups_
()
{
}
Group
paths
(
const
std
::
string
&
name
)
const
;
Optional
<
Path
>
path
(
const
std
::
string
&
name
,
Http
::
Method
method
)
const
;
...
...
@@ -437,6 +449,10 @@ class Swagger {
public:
Swagger
(
const
Description
&
description
)
:
description_
(
description
)
,
uiPath_
()
,
uiDirectory_
()
,
apiPath_
()
,
serializer_
()
{
}
typedef
std
::
function
<
std
::
string
(
const
Description
&
)
>
Serializer
;
...
...
@@ -445,7 +461,7 @@ public:
Swagger
&
uiDirectory
(
std
::
string
dir
);
Swagger
&
apiPath
(
std
::
string
path
);
Swagger
&
serializer
(
Serializer
serialize
);
void
install
(
Rest
::
Router
&
router
);
private:
...
...
include/pistache/mailbox.h
View file @
7a5c4f44
...
...
@@ -174,6 +174,8 @@ public:
};
Queue
()
:
head
()
,
tail
(
nullptr
)
{
auto
*
sentinel
=
new
Entry
;
sentinel
->
next
=
nullptr
;
...
...
include/pistache/router.h
View file @
7a5c4f44
...
...
@@ -235,6 +235,12 @@ public:
Route
::
Status
route
(
const
Http
::
Request
&
request
,
Http
::
ResponseWriter
response
);
Router
()
:
routes
()
,
customHandlers
()
,
notFoundHandler
()
{
}
private:
void
addRoute
(
Http
::
Method
method
,
const
std
::
string
&
resource
,
...
...
include/pistache/stream.h
View file @
7a5c4f44
...
...
@@ -84,6 +84,8 @@ public:
static
size_t
maxSize
;
ArrayStreamBuf
()
:
StreamBuf
<
CharT
>
()
,
bytes
()
{
bytes
.
clear
();
Base
::
setg
(
bytes
.
data
(),
bytes
.
data
(),
bytes
.
data
()
+
bytes
.
size
());
...
...
include/pistache/view.h
View file @
7a5c4f44
...
...
@@ -42,12 +42,14 @@ public:
,
size_
(
size
)
{
}
explicit
ViewBase
(
const
T
*
begin
,
const
T
*
end
)
{
explicit
ViewBase
(
const
T
*
begin
,
const
T
*
end
)
:
begin_
(
begin
)
,
size_
(
0
)
{
if
(
begin
>
end
)
{
throw
std
::
invalid_argument
(
"begin > end"
);
}
begin_
=
begin
;
size_
=
std
::
distance
(
begin
,
end
);
}
...
...
src/common/cookie.cc
View file @
7a5c4f44
...
...
@@ -225,7 +225,7 @@ CookieJar::add(const Cookie& cookie) {
}
void
// Unimplemented
CookieJar
::
removeCookie
(
const
std
::
string
&
name
)
{
CookieJar
::
removeCookie
(
const
std
::
string
&
/*name*/
)
{
// Empty for now, can be used later
}
...
...
src/common/description.cc
View file @
7a5c4f44
...
...
@@ -45,7 +45,10 @@ Info::Info(
:
title
(
std
::
move
(
title
))
,
version
(
std
::
move
(
version
))
,
description
(
std
::
move
(
description
))
{
}
,
termsOfService
()
,
contact
()
,
license
()
{
}
PathDecl
::
PathDecl
(
std
::
string
value
,
Http
::
Method
method
)
...
...
@@ -59,6 +62,10 @@ Path::Path(
,
method
(
method
)
,
description
(
std
::
move
(
description
))
,
hidden
(
false
)
,
pc
()
,
parameters
()
,
responses
()
,
handler
()
{
}
std
::
string
...
...
@@ -191,7 +198,8 @@ PathBuilder::PathBuilder(Path* path)
SubPath
::
SubPath
(
std
::
string
prefix
,
PathGroup
*
paths
)
:
prefix
(
std
::
move
(
prefix
))
,
paths
(
paths
)
,
parameters
()
,
paths
(
paths
)
{
}
PathBuilder
...
...
@@ -220,7 +228,8 @@ Parameter::Parameter(
:
name
(
std
::
move
(
name
))
,
description
(
std
::
move
(
description
))
,
required
(
true
)
{
}
,
type
()
{
}
Response
::
Response
(
Http
::
Code
statusCode
,
std
::
string
description
)
...
...
@@ -260,6 +269,11 @@ InfoBuilder::license(std::string name, std::string url) {
Description
::
Description
(
std
::
string
title
,
std
::
string
version
,
std
::
string
description
)
:
info_
(
std
::
move
(
title
),
std
::
move
(
version
),
std
::
move
(
description
))
,
host_
()
,
basePath_
()
,
schemes_
()
,
pc
()
,
paths_
()
{
}
...
...
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