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
79e89eb2
Commit
79e89eb2
authored
Jul 17, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CommandLine: use constexpr Path instead of macros
parent
d13a6445
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
CommandLine.cxx
src/CommandLine.cxx
+9
-9
No files found.
src/CommandLine.cxx
View file @
79e89eb2
...
...
@@ -67,14 +67,16 @@
#include <stdio.h>
#include <stdlib.h>
namespace
{
#ifdef _WIN32
#define CONFIG_FILE_LOCATION PATH_LITERAL("mpd\\mpd.conf")
#define APP_CONFIG_FILE_LOCATION PATH_LITERAL("conf\\mpd.conf")
constexpr
auto
CONFIG_FILE_LOCATION
=
Path
::
FromFS
(
PATH_LITERAL
(
"mpd
\\
mpd.conf"
));
constexpr
auto
APP_CONFIG_FILE_LOCATION
=
Path
::
FromFS
(
PATH_LITERAL
(
"conf
\\
mpd.conf"
));
#else
#define USER_CONFIG_FILE_LOCATION1 PATH_LITERAL(".mpdconf")
#define USER_CONFIG_FILE_LOCATION2 PATH_LITERAL(".mpd/mpd.conf")
#define USER_CONFIG_FILE_LOCATION_XDG PATH_LITERAL("mpd/mpd.conf")
constexpr
auto
USER_CONFIG_FILE_LOCATION1
=
Path
::
FromFS
(
PATH_LITERAL
(
".mpdconf"
));
constexpr
auto
USER_CONFIG_FILE_LOCATION2
=
Path
::
FromFS
(
PATH_LITERAL
(
".mpd/mpd.conf"
));
constexpr
auto
USER_CONFIG_FILE_LOCATION_XDG
=
Path
::
FromFS
(
PATH_LITERAL
(
"mpd/mpd.conf"
));
#endif
}
enum
Option
{
OPTION_KILL
,
...
...
@@ -292,8 +294,7 @@ class ConfigLoader
{
public
:
bool
TryFile
(
const
Path
path
);
bool
TryFile
(
const
AllocatedPath
&
base_path
,
PathTraitsFS
::
const_pointer_type
path
);
bool
TryFile
(
const
AllocatedPath
&
base_path
,
Path
path
);
};
bool
ConfigLoader
::
TryFile
(
Path
path
)
...
...
@@ -305,8 +306,7 @@ bool ConfigLoader::TryFile(Path path)
return
false
;
}
bool
ConfigLoader
::
TryFile
(
const
AllocatedPath
&
base_path
,
PathTraitsFS
::
const_pointer_type
path
)
bool
ConfigLoader
::
TryFile
(
const
AllocatedPath
&
base_path
,
Path
path
)
{
if
(
base_path
.
IsNull
())
return
false
;
...
...
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