MPD  0.20.18
Public Types | Static Public Member Functions | Static Public Attributes
PathTraitsUTF8 Struct Reference

This class describes the nature of a MPD internal filesystem path. More...

#include <Traits.hxx>

Public Types

typedef std::string string
 
typedef string::traits_type char_traits
 
typedef char_traits::char_type value_type
 
typedef value_typepointer_type
 
typedef const value_typeconst_pointer_type
 

Static Public Member Functions

static constexpr bool IsSeparator (value_type ch)
 
gcc_pure static gcc_nonnull_all const_pointer_type FindLastSeparator (const_pointer_type p) noexcept
 
gcc_pure static gcc_nonnull_all bool IsAbsolute (const_pointer_type p) noexcept
 
gcc_pure static gcc_nonnull_all size_t GetLength (const_pointer_type p) noexcept
 
gcc_pure static gcc_nonnull_all const_pointer_type Find (const_pointer_type p, value_type ch) noexcept
 
gcc_pure static gcc_nonnull_all const_pointer_type GetBase (const_pointer_type p) noexcept
 Determine the "base" file name of the given UTF-8 path. More...
 
gcc_pure static gcc_nonnull_all string GetParent (const_pointer_type p) noexcept
 Determine the "parent" file name of the given UTF-8 path. More...
 
gcc_pure static gcc_nonnull_all const_pointer_type Relative (const_pointer_type base, const_pointer_type other) noexcept
 Determine the relative part of the given path to this object, not including the directory separator. More...
 
gcc_pure static gcc_nonnull_all string Build (const_pointer_type a, size_t a_size, const_pointer_type b, size_t b_size) noexcept
 Constructs the path from the given components. More...
 
gcc_pure static gcc_nonnull_all string Build (const_pointer_type a, const_pointer_type b) noexcept
 

Static Public Attributes

static constexpr value_type SEPARATOR = '/'
 
static constexpr const_pointer_type CURRENT_DIRECTORY = "."
 

Detailed Description

This class describes the nature of a MPD internal filesystem path.

Definition at line 166 of file Traits.hxx.

Member Typedef Documentation

◆ char_traits

typedef string::traits_type PathTraitsUTF8::char_traits

Definition at line 168 of file Traits.hxx.

◆ const_pointer_type

Definition at line 171 of file Traits.hxx.

◆ pointer_type

Definition at line 170 of file Traits.hxx.

◆ string

typedef std::string PathTraitsUTF8::string

Definition at line 167 of file Traits.hxx.

◆ value_type

typedef char_traits::char_type PathTraitsUTF8::value_type

Definition at line 169 of file Traits.hxx.

Member Function Documentation

◆ Build() [1/2]

gcc_pure static gcc_nonnull_all string PathTraitsUTF8::Build ( const_pointer_type  a,
size_t  a_size,
const_pointer_type  b,
size_t  b_size 
)
staticnoexcept

Constructs the path from the given components.

If either of the components is empty string, remaining component is returned unchanged. If both components are empty strings, empty string is returned.

◆ Build() [2/2]

gcc_pure static gcc_nonnull_all string PathTraitsUTF8::Build ( const_pointer_type  a,
const_pointer_type  b 
)
inlinestaticnoexcept

Definition at line 258 of file Traits.hxx.

◆ Find()

gcc_pure static gcc_nonnull_all const_pointer_type PathTraitsUTF8::Find ( const_pointer_type  p,
value_type  ch 
)
inlinestaticnoexcept

Definition at line 218 of file Traits.hxx.

◆ FindLastSeparator()

gcc_pure static gcc_nonnull_all const_pointer_type PathTraitsUTF8::FindLastSeparator ( const_pointer_type  p)
inlinestaticnoexcept

Definition at line 182 of file Traits.hxx.

◆ GetBase()

gcc_pure static gcc_nonnull_all const_pointer_type PathTraitsUTF8::GetBase ( const_pointer_type  p)
staticnoexcept

Determine the "base" file name of the given UTF-8 path.

The return value points inside the given string.

◆ GetLength()

gcc_pure static gcc_nonnull_all size_t PathTraitsUTF8::GetLength ( const_pointer_type  p)
inlinestaticnoexcept

Definition at line 213 of file Traits.hxx.

◆ GetParent()

gcc_pure static gcc_nonnull_all string PathTraitsUTF8::GetParent ( const_pointer_type  p)
staticnoexcept

Determine the "parent" file name of the given UTF-8 path.

As a special case, returns the string "." if there is no separator in the given input string.

◆ IsAbsolute()

gcc_pure static gcc_nonnull_all bool PathTraitsUTF8::IsAbsolute ( const_pointer_type  p)
inlinestaticnoexcept

Definition at line 199 of file Traits.hxx.

◆ IsSeparator()

static constexpr bool PathTraitsUTF8::IsSeparator ( value_type  ch)
inlinestatic

Definition at line 177 of file Traits.hxx.

◆ Relative()

gcc_pure static gcc_nonnull_all const_pointer_type PathTraitsUTF8::Relative ( const_pointer_type  base,
const_pointer_type  other 
)
staticnoexcept

Determine the relative part of the given path to this object, not including the directory separator.

Returns an empty string if the given path equals this object or nullptr on mismatch.

Field Documentation

◆ CURRENT_DIRECTORY

constexpr const_pointer_type PathTraitsUTF8::CURRENT_DIRECTORY = "."
static

Definition at line 175 of file Traits.hxx.

◆ SEPARATOR

constexpr value_type PathTraitsUTF8::SEPARATOR = '/'
static

Definition at line 173 of file Traits.hxx.


The documentation for this struct was generated from the following file: