Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0ec1863f
Commit
0ec1863f
authored
Jan 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/Print: add "noexcept"
parent
2b67a141
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+20
-14
No files found.
src/db/DatabasePrint.cxx
View file @
0ec1863f
...
...
@@ -38,8 +38,9 @@
#include <functional>
gcc_pure
static
const
char
*
ApplyBaseFlag
(
const
char
*
uri
,
bool
base
)
ApplyBaseFlag
(
const
char
*
uri
,
bool
base
)
noexcept
{
if
(
base
)
uri
=
PathTraitsUTF8
::
GetBase
(
uri
);
...
...
@@ -47,21 +48,24 @@ ApplyBaseFlag(const char *uri, bool base)
}
static
void
PrintDirectoryURI
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
PrintDirectoryURI
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
noexcept
{
r
.
Format
(
"directory: %s
\n
"
,
ApplyBaseFlag
(
directory
.
GetPath
(),
base
));
}
static
void
PrintDirectoryBrief
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
PrintDirectoryBrief
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
noexcept
{
if
(
!
directory
.
IsRoot
())
PrintDirectoryURI
(
r
,
base
,
directory
);
}
static
void
PrintDirectoryFull
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
PrintDirectoryFull
(
Response
&
r
,
bool
base
,
const
LightDirectory
&
directory
)
noexcept
{
if
(
!
directory
.
IsRoot
())
{
PrintDirectoryURI
(
r
,
base
,
directory
);
...
...
@@ -74,7 +78,7 @@ PrintDirectoryFull(Response &r, bool base, const LightDirectory &directory)
static
void
print_playlist_in_directory
(
Response
&
r
,
bool
base
,
const
char
*
directory
,
const
char
*
name_utf8
)
const
char
*
name_utf8
)
noexcept
{
if
(
base
||
directory
==
nullptr
)
r
.
Format
(
"playlist: %s
\n
"
,
...
...
@@ -87,7 +91,7 @@ print_playlist_in_directory(Response &r, bool base,
static
void
print_playlist_in_directory
(
Response
&
r
,
bool
base
,
const
LightDirectory
*
directory
,
const
char
*
name_utf8
)
const
char
*
name_utf8
)
noexcept
{
if
(
base
||
directory
==
nullptr
||
directory
->
IsRoot
())
r
.
Format
(
"playlist: %s
\n
"
,
name_utf8
);
...
...
@@ -97,7 +101,7 @@ print_playlist_in_directory(Response &r, bool base,
}
static
void
PrintSongBrief
(
Response
&
r
,
bool
base
,
const
LightSong
&
song
)
PrintSongBrief
(
Response
&
r
,
bool
base
,
const
LightSong
&
song
)
noexcept
{
song_print_uri
(
r
,
song
,
base
);
...
...
@@ -108,7 +112,7 @@ PrintSongBrief(Response &r, bool base, const LightSong &song)
}
static
void
PrintSongFull
(
Response
&
r
,
bool
base
,
const
LightSong
&
song
)
PrintSongFull
(
Response
&
r
,
bool
base
,
const
LightSong
&
song
)
noexcept
{
song_print_info
(
r
,
song
,
base
);
...
...
@@ -121,7 +125,7 @@ PrintSongFull(Response &r, bool base, const LightSong &song)
static
void
PrintPlaylistBrief
(
Response
&
r
,
bool
base
,
const
PlaylistInfo
&
playlist
,
const
LightDirectory
&
directory
)
const
LightDirectory
&
directory
)
noexcept
{
print_playlist_in_directory
(
r
,
base
,
&
directory
,
playlist
.
name
.
c_str
());
...
...
@@ -130,7 +134,7 @@ PrintPlaylistBrief(Response &r, bool base,
static
void
PrintPlaylistFull
(
Response
&
r
,
bool
base
,
const
PlaylistInfo
&
playlist
,
const
LightDirectory
&
directory
)
const
LightDirectory
&
directory
)
noexcept
{
print_playlist_in_directory
(
r
,
base
,
&
directory
,
playlist
.
name
.
c_str
());
...
...
@@ -139,8 +143,9 @@ PrintPlaylistFull(Response &r, bool base,
time_print
(
r
,
"Last-Modified"
,
playlist
.
mtime
);
}
gcc_pure
static
bool
CompareNumeric
(
const
char
*
a
,
const
char
*
b
)
CompareNumeric
(
const
char
*
a
,
const
char
*
b
)
noexcept
{
long
a_value
=
strtol
(
a
,
nullptr
,
10
);
long
b_value
=
strtol
(
b
,
nullptr
,
10
);
...
...
@@ -148,8 +153,9 @@ CompareNumeric(const char *a, const char *b)
return
a_value
<
b_value
;
}
gcc_pure
static
bool
CompareTags
(
TagType
type
,
bool
descending
,
const
Tag
&
a
,
const
Tag
&
b
)
CompareTags
(
TagType
type
,
bool
descending
,
const
Tag
&
a
,
const
Tag
&
b
)
noexcept
{
const
char
*
a_value
=
a
.
GetSortValue
(
type
);
const
char
*
b_value
=
b
.
GetSortValue
(
type
);
...
...
@@ -262,14 +268,14 @@ db_selection_print(Response &r, Partition &partition,
}
static
void
PrintSongURIVisitor
(
Response
&
r
,
const
LightSong
&
song
)
PrintSongURIVisitor
(
Response
&
r
,
const
LightSong
&
song
)
noexcept
{
song_print_uri
(
r
,
song
);
}
static
void
PrintUniqueTag
(
Response
&
r
,
TagType
tag_type
,
const
Tag
&
tag
)
const
Tag
&
tag
)
noexcept
{
const
char
*
value
=
tag
.
GetValue
(
tag_type
);
assert
(
value
!=
nullptr
);
...
...
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