LLVM 22.0.0git
llvm::sys::path::const_iterator Class Reference

Path iterator. More...

#include "llvm/Support/Path.h"

Inheritance diagram for llvm::sys::path::const_iterator:
[legend]

Public Member Functions

reference operator* () const
LLVM_ABI const_iteratoroperator++ ()
LLVM_ABI bool operator== (const const_iterator &RHS) const
LLVM_ABI ptrdiff_t operator- (const const_iterator &RHS) const
 Difference in bytes between this and RHS.
Public Member Functions inherited from llvm::iterator_facade_base< const_iterator, std::input_iterator_tag, const StringRef >
const_iterator operator+ (std::ptrdiff_t n) const
const_iterator operator- (std::ptrdiff_t n) const
const_iteratoroperator++ ()
const_iteratoroperator-- ()
bool operator!= (const const_iterator &RHS) const
bool operator> (const const_iterator &RHS) const
bool operator<= (const const_iterator &RHS) const
bool operator>= (const const_iterator &RHS) const
PointerProxy operator-> () const
ReferenceProxy operator[] (std::ptrdiff_t n) const

Friends

LLVM_ABI friend const_iterator begin (StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
 Get begin iterator over path.
LLVM_ABI friend const_iterator end (StringRef path LLVM_LIFETIME_BOUND)
 Get end iterator over path.

Additional Inherited Members

Public Types inherited from llvm::iterator_facade_base< const_iterator, std::input_iterator_tag, const StringRef >
using iterator_category
using value_type
using difference_type
using pointer
using reference
Protected Types inherited from llvm::iterator_facade_base< const_iterator, std::input_iterator_tag, const StringRef >
enum  

Detailed Description

Path iterator.

This is an input iterator that iterates over the individual components in path. The traversal order is as follows:

  • The root-name element, if present.
  • The root-directory element, if present.
  • Each successive filename element, if present.
  • Dot, if one or more trailing non-root slash characters are present. Traversing backwards is possible with reverse_iterator

Iteration examples. Each component is separated by ',':

/ => /
/foo => /,foo
foo/ => foo,.
/foo/bar => /,foo,bar
../ => ..,.
C:\foo\bar => C:,\,foo,bar
@ C
The default llvm calling convention, compatible with C.
Definition CallingConv.h:34

Definition at line 74 of file Path.h.

Member Function Documentation

◆ operator*()

reference llvm::sys::path::const_iterator::operator* ( ) const
inline

Definition at line 87 of file Path.h.

◆ operator++()

const_iterator & llvm::sys::path::const_iterator::operator++ ( )

◆ operator-()

ptrdiff_t llvm::sys::path::const_iterator::operator- ( const const_iterator & RHS) const

Difference in bytes between this and RHS.

Definition at line 293 of file Path.cpp.

◆ operator==()

bool llvm::sys::path::const_iterator::operator== ( const const_iterator & RHS) const

Definition at line 289 of file Path.cpp.

◆ begin

LLVM_ABI friend const_iterator begin ( StringRef path LLVM_LIFETIME_BOUND,
Style style = Style::native )
friend

Get begin iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized with the first component of path.

Definition at line 226 of file Path.cpp.

◆ end

LLVM_ABI friend const_iterator end ( StringRef path LLVM_LIFETIME_BOUND)
friend

Get end iterator over path.

Parameters
pathInput path.
Returns
Iterator initialized to the end of path.

Definition at line 235 of file Path.cpp.


The documentation for this class was generated from the following files: