StuBS
util.h File Reference
#include <string>
#include <vector>
#include <functional>
#include "fs_interface.h"
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Functions

bool imageload (std::string path)
 
bool imagesync ()
 
bool imageclose ()
 
std::string imagename ()
 
bool checkError (FileSystemInterface *const fs, int e)
 
bool printError (int e)
 
std::string getcwd (FileSystemInterface *const fs)
 
std::string readlink (FileSystemInterface *const fs, std::string symlink)
 
std::string join (const std::vector< std::string > &vec, const char *delim)
 
std::string filesize (unsigned long size, bool showBytes=false)
 
std::string basename (std::string const &path)
 
std::string dirname (std::string const &path)
 
bool recursive (FileSystemInterface *const fs, const std::string &path, const std::function< bool(const std::string &, const FileSystemInterface::FileType &)> callback)
 
bool list (FileSystemInterface *const fs, const std::string &path, bool recursive=false)
 
bool stat (FileSystemInterface *const fs, const std::string &path)
 
bool cat (FileSystemInterface *const fs, const std::string &path)
 
bool transfer (FileSystemInterface *const source, FileSystemInterface *const target, const std::string &path_source, std::string path_target, bool targetAsDir=true)
 

Function Documentation

◆ imageload()

bool imageload ( std::string  path)

◆ imagesync()

bool imagesync ( )

◆ imageclose()

bool imageclose ( )

◆ imagename()

std::string imagename ( )

◆ checkError()

bool checkError ( FileSystemInterface *const  fs,
int  e 
)

◆ printError()

bool printError ( int  e)

◆ getcwd()

std::string getcwd ( FileSystemInterface *const  fs)

◆ readlink()

std::string readlink ( FileSystemInterface *const  fs,
std::string  symlink 
)

◆ join()

std::string join ( const std::vector< std::string > &  vec,
const char *  delim 
)

◆ filesize()

std::string filesize ( unsigned long  size,
bool  showBytes = false 
)

◆ basename()

std::string basename ( std::string const &  path)

◆ dirname()

std::string dirname ( std::string const &  path)

◆ recursive()

bool recursive ( FileSystemInterface *const  fs,
const std::string &  path,
const std::function< bool(const std::string &, const FileSystemInterface::FileType &)>  callback 
)

◆ list()

bool list ( FileSystemInterface *const  fs,
const std::string &  path,
bool  recursive = false 
)

◆ stat()

bool stat ( FileSystemInterface *const  fs,
const std::string &  path 
)

◆ cat()

bool cat ( FileSystemInterface *const  fs,
const std::string &  path 
)

◆ transfer()

bool transfer ( FileSystemInterface *const  source,
FileSystemInterface *const  target,
const std::string &  path_source,
std::string  path_target,
bool  targetAsDir = true 
)