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
61d7b436
Commit
61d7b436
authored
5 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/NarrowPath: un-inline Windows constructor
parent
cdddaf21
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
9 deletions
+38
-9
NarrowPath.cxx
src/fs/NarrowPath.cxx
+36
-0
NarrowPath.hxx
src/fs/NarrowPath.hxx
+1
-9
meson.build
src/fs/meson.build
+1
-0
No files found.
src/fs/NarrowPath.cxx
0 → 100644
View file @
61d7b436
/*
* Copyright 2003-2018 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "NarrowPath.hxx"
#ifdef _UNICODE
#include "lib/icu/Win32.hxx"
#include <windows.h>
NarrowPath
::
NarrowPath
(
Path
_path
)
noexcept
:
value
(
WideCharToMultiByte
(
CP_ACP
,
_path
.
c_str
()))
{
if
(
value
.
IsNull
())
/* fall back to empty string */
value
=
Value
::
Empty
();
}
#endif
/* _UNICODE */
This diff is collapsed.
Click to expand it.
src/fs/NarrowPath.hxx
View file @
61d7b436
...
...
@@ -21,12 +21,9 @@
#define MPD_FS_NARROW_PATH_HXX
#include "Path.hxx"
#include "util/Macros.hxx"
#ifdef _UNICODE
#include "lib/icu/Win32.hxx"
#include "util/AllocatedString.hxx"
#include <windows.h>
#else
#include "util/StringPointer.hxx"
#endif
...
...
@@ -48,12 +45,7 @@ class NarrowPath {
public
:
#ifdef _UNICODE
explicit
NarrowPath
(
Path
_path
)
:
value
(
WideCharToMultiByte
(
CP_ACP
,
_path
.
c_str
()))
{
if
(
value
.
IsNull
())
/* fall back to empty string */
value
=
Value
::
Empty
();
}
explicit
NarrowPath
(
Path
_path
)
noexcept
;
#else
explicit
NarrowPath
(
Path
_path
)
:
value
(
_path
.
c_str
())
{}
#endif
...
...
This diff is collapsed.
Click to expand it.
src/fs/meson.build
View file @
61d7b436
...
...
@@ -6,6 +6,7 @@ fs_sources = [
'Path.cxx',
'Path2.cxx',
'AllocatedPath.cxx',
'NarrowPath.cxx',
'FileSystem.cxx',
'List.cxx',
'StandardDirectory.cxx',
...
...
This diff is collapsed.
Click to expand it.
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