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
7ccc609d
Commit
7ccc609d
authored
Mar 01, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update/ExcludeList: make no-op if GLib is disabled
Quick hack to allow using the database without GLib (for Android).
parent
ebc01680
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
ExcludeList.cxx
src/db/update/ExcludeList.cxx
+10
-0
ExcludeList.hxx
src/db/update/ExcludeList.hxx
+12
-0
No files found.
src/db/update/ExcludeList.cxx
View file @
7ccc609d
...
@@ -39,6 +39,7 @@ static constexpr Domain exclude_list_domain("exclude_list");
...
@@ -39,6 +39,7 @@ static constexpr Domain exclude_list_domain("exclude_list");
bool
bool
ExcludeList
::
LoadFile
(
Path
path_fs
)
ExcludeList
::
LoadFile
(
Path
path_fs
)
{
{
#ifdef HAVE_GLIB
FILE
*
file
=
FOpen
(
path_fs
,
FOpenMode
::
ReadText
);
FILE
*
file
=
FOpen
(
path_fs
,
FOpenMode
::
ReadText
);
if
(
file
==
nullptr
)
{
if
(
file
==
nullptr
)
{
const
int
e
=
errno
;
const
int
e
=
errno
;
...
@@ -64,6 +65,10 @@ ExcludeList::LoadFile(Path path_fs)
...
@@ -64,6 +65,10 @@ ExcludeList::LoadFile(Path path_fs)
}
}
fclose
(
file
);
fclose
(
file
);
#else
// TODO: implement
(
void
)
path_fs
;
#endif
return
true
;
return
true
;
}
}
...
@@ -75,9 +80,14 @@ ExcludeList::Check(Path name_fs) const
...
@@ -75,9 +80,14 @@ ExcludeList::Check(Path name_fs) const
/* XXX include full path name in check */
/* XXX include full path name in check */
#ifdef HAVE_GLIB
for
(
const
auto
&
i
:
patterns
)
for
(
const
auto
&
i
:
patterns
)
if
(
i
.
Check
(
name_fs
.
c_str
()))
if
(
i
.
Check
(
name_fs
.
c_str
()))
return
true
;
return
true
;
#else
// TODO: implement
(
void
)
name_fs
;
#endif
return
false
;
return
false
;
}
}
src/db/update/ExcludeList.hxx
View file @
7ccc609d
...
@@ -25,15 +25,19 @@
...
@@ -25,15 +25,19 @@
#ifndef MPD_EXCLUDE_H
#ifndef MPD_EXCLUDE_H
#define MPD_EXCLUDE_H
#define MPD_EXCLUDE_H
#include "check.h"
#include "Compiler.h"
#include "Compiler.h"
#include <forward_list>
#include <forward_list>
#ifdef HAVE_GLIB
#include <glib.h>
#include <glib.h>
#endif
class
Path
;
class
Path
;
class
ExcludeList
{
class
ExcludeList
{
#ifdef HAVE_GLIB
class
Pattern
{
class
Pattern
{
GPatternSpec
*
pattern
;
GPatternSpec
*
pattern
;
...
@@ -57,11 +61,19 @@ class ExcludeList {
...
@@ -57,11 +61,19 @@ class ExcludeList {
};
};
std
::
forward_list
<
Pattern
>
patterns
;
std
::
forward_list
<
Pattern
>
patterns
;
#else
// TODO: implement
#endif
public
:
public
:
gcc_pure
gcc_pure
bool
IsEmpty
()
const
{
bool
IsEmpty
()
const
{
#ifdef HAVE_GLIB
return
patterns
.
empty
();
return
patterns
.
empty
();
#else
// TODO: implement
return
true
;
#endif
}
}
/**
/**
...
...
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