Switchboard SDK
Loading...
Searching...
No Matches
switchboard::FileSystem Struct Reference

Contains file manipulation utility methods. More...

#include <FileSystem.hpp>

Static Public Member Functions

static bool fileExists (const std::string &filePath)
 Check if a file exists.
 
static bool deleteFile (const std::string &filePath)
 Delete the file at filePath.
 
static bool isDirectory (const std::string &path)
 Checks if the directory exists.
 
static bool createDirectory (const std::string &path)
 Creates a directory.
 
static std::string getFileExtension (const std::string &path)
 Gets extension of the file.
 
static std::string getAbsoluteFilePath (const std::string &path)
 Gets absolute path of a file from relative path..
 

Detailed Description

Contains file manipulation utility methods.

FileSystem struct.

Member Function Documentation

◆ createDirectory()

bool switchboard::FileSystem::createDirectory ( const std::string & path)
static

Creates a directory.

Parameters
pathPath to the directory to be created.
Returns
True if the directory was successfully created.

◆ deleteFile()

bool switchboard::FileSystem::deleteFile ( const std::string & filePath)
static

Delete the file at filePath.

Parameters
filePathPath to the file.
Returns
True if the file is deleted/non-existent.

◆ fileExists()

bool switchboard::FileSystem::fileExists ( const std::string & filePath)
static

Check if a file exists.

Parameters
filePathPath to the file.
Returns
True if the file exists.

◆ getAbsoluteFilePath()

std::string switchboard::FileSystem::getAbsoluteFilePath ( const std::string & path)
static

Gets absolute path of a file from relative path..

Parameters
pathRelatiive path to of the file to get absolute path of..
Returns
String that contains absolute path.

◆ getFileExtension()

std::string switchboard::FileSystem::getFileExtension ( const std::string & path)
static

Gets extension of the file.

Parameters
pathPath to the file to get extension of.
Returns
String that contains extension of the input file path.

◆ isDirectory()

bool switchboard::FileSystem::isDirectory ( const std::string & path)
static

Checks if the directory exists.

Parameters
pathpath to the file.
Returns
True if the file is a directory.