plptools
Loading...
Searching...
No Matches
pathutils.cc File Reference
#include "config.h"
#include "pathutils.h"
#include "xalloc.h"
#include "xvasprintf.h"
#include <string>
#include <unistd.h>
Include dependency graph for pathutils.cc:

Go to the source code of this file.

Functions

static bool is_drive_component (const std::string &pathComponent)
 
static bool is_separator (const std::string &pathComponent, const pathutils::PathFormat format)
 
static bool is_absolute (const std::vector< std::string > &components, const pathutils::PathFormat format)
 
static bool is_rooted (const std::vector< std::string > &components, const pathutils::PathFormat format)
 
static std::string drive_component (const std::vector< std::string > components, const pathutils::PathFormat format)
 
static std::vector< std::string >::const_iterator path_find_rootless_components_begin (const std::vector< std::string > &components, const pathutils::PathFormat format)
 Return the iterator corresponding with the beginning of the path components. More...
 

Function Documentation

◆ drive_component()

static std::string drive_component ( const std::vector< std::string >  components,
const pathutils::PathFormat  format 
)
static

Definition at line 62 of file pathutils.cc.

◆ is_absolute()

static bool is_absolute ( const std::vector< std::string > &  components,
const pathutils::PathFormat  format 
)
static

Definition at line 43 of file pathutils.cc.

◆ is_drive_component()

static bool is_drive_component ( const std::string &  pathComponent)
static

Definition at line 33 of file pathutils.cc.

◆ is_rooted()

static bool is_rooted ( const std::vector< std::string > &  components,
const pathutils::PathFormat  format 
)
static

Definition at line 52 of file pathutils.cc.

◆ is_separator()

static bool is_separator ( const std::string &  pathComponent,
const pathutils::PathFormat  format 
)
static

Definition at line 39 of file pathutils.cc.

◆ path_find_rootless_components_begin()

static std::vector< std::string >::const_iterator path_find_rootless_components_begin ( const std::vector< std::string > &  components,
const pathutils::PathFormat  format 
)
static

Return the iterator corresponding with the beginning of the path components.

May be used to split the path into the vectors containing the root markers ('C:', '\', '/') and the remaining path components.

The implementation is pretty simple—it just scans forward through the path components looking for the drive and/or root path component.

Definition at line 235 of file pathutils.cc.