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
4c0916df
Commit
4c0916df
authored
Jun 23, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Path: use base class StringPointer
parent
e4844b99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
Path.hxx
src/fs/Path.hxx
+6
-10
Traits.hxx
src/fs/Traits.hxx
+4
-2
No files found.
src/fs/Path.hxx
View file @
4c0916df
...
...
@@ -37,14 +37,10 @@ class AllocatedPath;
* This class manages a pointer to an existing path string. While an
* instance lives, the string must not be invalidated.
*/
class
Path
{
typedef
PathTraitsFS
::
value_type
value_type
;
typedef
PathTraitsFS
::
pointer
pointer
;
typedef
PathTraitsFS
::
const_pointer
const_pointer
;
class
Path
:
public
PathTraitsFS
::
Pointer
{
typedef
PathTraitsFS
::
Pointer
Base
;
const_pointer
value
;
constexpr
Path
(
const_pointer
_value
)
:
value
(
_value
)
{}
constexpr
Path
(
const_pointer
_value
)
:
Base
(
_value
)
{}
public
:
/**
...
...
@@ -80,7 +76,7 @@ public:
* must not be used.
*/
bool
IsNull
()
const
{
return
value
==
nullptr
;
return
Base
::
IsNull
()
;
}
/**
...
...
@@ -89,7 +85,7 @@ public:
* @see IsNull()
*/
void
SetNull
()
{
value
=
nullptr
;
*
this
=
nullptr
;
}
/**
...
...
@@ -110,7 +106,7 @@ public:
*/
gcc_pure
const_pointer
c_str
()
const
{
return
value
;
return
Base
::
c_str
()
;
}
/**
...
...
src/fs/Traits.hxx
View file @
4c0916df
...
...
@@ -22,6 +22,7 @@
#include "check.h"
#include "Compiler.h"
#include "util/StringPointer.hxx"
#include "util/StringAPI.hxx"
#ifdef WIN32
...
...
@@ -50,8 +51,9 @@ struct PathTraitsFS {
#endif
typedef
string
::
traits_type
char_traits
;
typedef
char_traits
::
char_type
value_type
;
typedef
value_type
*
pointer
;
typedef
const
value_type
*
const_pointer
;
typedef
StringPointer
<
value_type
>
Pointer
;
typedef
Pointer
::
pointer
pointer
;
typedef
Pointer
::
const_pointer
const_pointer
;
#ifdef WIN32
static
constexpr
value_type
SEPARATOR
=
'\\'
;
...
...
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