NumCpp  2.9.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::filesystem::File Class Reference

Provides simple filesystem functions. More...

#include <Filesystem.hpp>

Public Member Functions

 File (const std::string &filename)
 
bool exists () const noexcept
 
const std::string & ext () const noexcept
 
std::string fullName () const
 
bool hasExt () const
 
const std::string & name () const noexcept
 
std::string withExt (const std::string &ext)
 

Detailed Description

Provides simple filesystem functions.

Constructor & Destructor Documentation

◆ File()

nc::filesystem::File::File ( const std::string &  filename)
inlineexplicit

Constructor

Parameters
filenamethe full filename

Member Function Documentation

◆ exists()

bool nc::filesystem::File::exists ( ) const
inlinenoexcept

Tests whether or not the file exists

Returns
bool

◆ ext()

const std::string& nc::filesystem::File::ext ( ) const
inlinenoexcept

Returns the file extension without the dot

Returns
std::string

◆ fullName()

std::string nc::filesystem::File::fullName ( ) const
inline

Returns the input full filename

Returns
std::string

◆ hasExt()

bool nc::filesystem::File::hasExt ( ) const
inline

Returns true if the file has an extension

Returns
bool

◆ name()

const std::string& nc::filesystem::File::name ( ) const
inlinenoexcept

Returns the filename

Returns
std::string

◆ withExt()

std::string nc::filesystem::File::withExt ( const std::string &  ext)
inline

Sets the extension to the input extension. Do not input the dot. E.g. input "txt", not ".txt"

Returns
std::string

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