jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::fs::dir_item Class Reference

Representing a directory item split into dirname() and basename(). More...

#include <file_util.hpp>

Collaboration diagram for jau::fs::dir_item:

Public Member Functions

 dir_item () noexcept
 Empty item w/ .
 
 dir_item (const std::string_view &path_) noexcept
 Create a dir_item where path is split into dirname and basename after .
 
 dir_item (std::string dirname__, std::string basename__) noexcept
 Create a dir_item with already cleaned dirname and basename without any further processing nor validation.
 
const std::string & basename () const noexcept
 Return the basename, shall not be empty nor contain a dirname.
 
const std::string & dirname () const noexcept
 Returns the dirname, shall not be empty and denotes .
 
bool empty () const noexcept
 Returns true if bot, dirname() and basename() refer to .
 
bool operator!= (const dir_item &rhs) const noexcept
 
bool operator== (const dir_item &rhs) const noexcept
 
std::string path () const noexcept
 Returns a full unix path representation combining dirname() and basename().
 
std::string to_string () const noexcept
 Returns a comprehensive string representation of this item.
 

Detailed Description

Representing a directory item split into dirname() and basename().

Definition at line 106 of file file_util.hpp.

Constructor & Destructor Documentation

◆ dir_item() [1/3]

dir_item::dir_item ( )
noexcept

Empty item w/ .

set for both, dirname and basename. empty() will return true;

Definition at line 351 of file file_util.cpp.

◆ dir_item() [2/3]

dir_item::dir_item ( const std::string_view & path_)
noexcept

Create a dir_item where path is split into dirname and basename after .

and .. has been reduced.

empty() will return true if given path_ is empty

Parameters
path_the raw path

Definition at line 354 of file file_util.cpp.

◆ dir_item() [3/3]

dir_item::dir_item ( std::string dirname__,
std::string basename__ )
noexcept

Create a dir_item with already cleaned dirname and basename without any further processing nor validation.

empty() will return true if both, given dirname_ and basename_ is empty

Parameters
dirname__
basename__
See also
reduce()
jau::fs::dirname()
jau::fs::basename()

Definition at line 347 of file file_util.cpp.

Member Function Documentation

◆ dirname()

const std::string & jau::fs::dir_item::dirname ( ) const
inlinenoexcept

Returns the dirname, shall not be empty and denotes .

for current working director.

Definition at line 212 of file file_util.hpp.

Here is the caller graph for this function:

◆ basename()

const std::string & jau::fs::dir_item::basename ( ) const
inlinenoexcept

Return the basename, shall not be empty nor contain a dirname.

Definition at line 215 of file file_util.hpp.

Here is the caller graph for this function:

◆ path()

std::string dir_item::path ( ) const
noexcept

Returns a full unix path representation combining dirname() and basename().

Definition at line 359 of file file_util.cpp.

Here is the caller graph for this function:

◆ empty()

bool jau::fs::dir_item::empty ( ) const
inlinenoexcept

Returns true if bot, dirname() and basename() refer to .

, e.g.. default ctor.

Definition at line 225 of file file_util.hpp.

Here is the caller graph for this function:

◆ operator==()

bool jau::fs::dir_item::operator== ( const dir_item & rhs) const
inlinenoexcept

Definition at line 227 of file file_util.hpp.

◆ operator!=()

bool jau::fs::dir_item::operator!= ( const dir_item & rhs) const
inlinenoexcept

Definition at line 231 of file file_util.hpp.

◆ to_string()

std::string dir_item::to_string ( ) const
noexcept

Returns a comprehensive string representation of this item.

Definition at line 372 of file file_util.cpp.

Here is the caller graph for this function:

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