#include <unixfs.hpp>
|
| using | FileList = std::list< std::string > |
| |
|
| static std::string | getCWD () |
| | get current working directory without trailing slash More...
|
| |
| static FileList | listFiles (const std::string &folder, const std::string &extension=std::string()) |
| | list all files with the extension ".extension" in folder More...
|
| |
| static std::string | stripPath (const std::string &filename) |
| | remove the full path from a filename More...
|
| |
| static std::string | readAll (const std::string &path) |
| | read all file contents and put it in a string More...
|
| |
| static bool | fileExists (const std::string &path) |
| |
| template<typename T > |
| static T | readSysFsValue (const std::string &path) |
| | read value from a sysfs file More...
|
| |
| template<typename T > |
| static void | writeSysFsValue (const std::string &path, const T &val) |
| | write value to a sysfs file More...
|
| |
Definition at line 39 of file unixfs.hpp.
◆ FileList
◆ UnixFs()
| Leosac::Tools::UnixFs::UnixFs |
( |
| ) |
|
|
privatedelete |
◆ fileExists()
| bool UnixFs::fileExists |
( |
const std::string & |
path | ) |
|
|
static |
- Parameters
-
- Returns
- true is file exists
Definition at line 109 of file unixfs.cpp.
◆ getCWD()
| std::string UnixFs::getCWD |
( |
| ) |
|
|
static |
get current working directory without trailing slash
- Returns
- path
Definition at line 40 of file unixfs.cpp.
◆ listFiles()
| UnixFs::FileList UnixFs::listFiles |
( |
const std::string & |
folder, |
|
|
const std::string & |
extension = std::string() |
|
) |
| |
|
static |
list all files with the extension ".extension" in folder
- Parameters
-
| folder | |
| extension | name without the dot |
- Returns
- file list
Definition at line 55 of file unixfs.cpp.
◆ readAll()
| std::string UnixFs::readAll |
( |
const std::string & |
path | ) |
|
|
static |
read all file contents and put it in a string
- Parameters
-
- Returns
- file contents
Definition at line 98 of file unixfs.cpp.
◆ readSysFsValue()
template<typename T >
| static T Leosac::Tools::UnixFs::readSysFsValue |
( |
const std::string & |
path | ) |
|
|
inlinestatic |
read value from a sysfs file
- Parameters
-
| path | Path of the sysfs target |
- Returns
- Value read
Definition at line 88 of file unixfs.hpp.
◆ stripPath()
| std::string UnixFs::stripPath |
( |
const std::string & |
filename | ) |
|
|
static |
remove the full path from a filename
- Parameters
-
- Returns
- filename without path
Definition at line 88 of file unixfs.cpp.
◆ writeSysFsValue()
template<typename T >
| static void Leosac::Tools::UnixFs::writeSysFsValue |
( |
const std::string & |
path, |
|
|
const T & |
val |
|
) |
| |
|
inlinestatic |
write value to a sysfs file
- Parameters
-
| path | Path of the sysfs target |
| val | Value to write |
Definition at line 107 of file unixfs.hpp.
The documentation for this class was generated from the following files: