sjef
Namespaces | Classes | Typedefs | Enumerations | Functions
sjef Namespace Reference

Namespaces

 util
 

Classes

class  Project
 
class  runtime_error
 

Typedefs

using mapstringstring_t = std::map< std::string, std::string >
 

Enumerations

enum  status : int {
  unknown = 0 , running = 1 , waiting = 2 , completed = 3 ,
  unevaluated = 4 , killed = 5 , failed = 6
}
 

Functions

bool check_backends (const std::string &suffix)
 Check whether a backend specification file is valid. Only the top-level structure of the file is checked, to the point where it could be opened and used in a Project. More...
 
std::filesystem::path expand_path (const std::filesystem::path &path, const std::string &suffix="")
 Edit a file path name. More...
 
std::string xmlRepair (const std::string &source, const mapstringstring_t &injections={})
 Repair an xml dataset by completing any open tags. More...
 
std::string version () noexcept
 Report the software version. More...
 

Typedef Documentation

◆ mapstringstring_t

using sjef::mapstringstring_t = typedef std::map<std::string, std::string>

Enumeration Type Documentation

◆ status

enum sjef::status : int
Enumerator
unknown 
running 
waiting 
completed 
unevaluated 
killed 
failed 

Function Documentation

◆ check_backends()

bool sjef::check_backends ( const std::string &  suffix)

Check whether a backend specification file is valid. Only the top-level structure of the file is checked, to the point where it could be opened and used in a Project.

Parameters
suffix/usr/local/etc/sjef/suffix/backends.xml and ~/.sjef/suffix/backends.xml will be checked
Returns

◆ expand_path()

std::filesystem::path sjef::expand_path ( const std::filesystem::path &  path,
const std::string &  suffix = "" 
)

Edit a file path name.

  • expand environment variables
  • expand ~ as the user home directory
  • map unix-specific environment variables HOME, TMPDIR to native counterparts
  • force all path separators (/,) to native form
  • resolve a relative input path to its fully-resolved form using the current working directory
  • if the file name does not end with a supplied suffix, append it
    Parameters
    path
    suffixIf given and not empty, if path does not end with this file suffix, append it
    Returns
    the expanded and sanitised path

◆ version()

std::string sjef::version ( )
noexcept

Report the software version.

Returns

◆ xmlRepair()

std::string sjef::xmlRepair ( const std::string &  source,
const mapstringstring_t injections = {} 
)

Repair an xml dataset by completing any open tags.

Parameters
sourceThe initial xml
injectionsxml nodes for which additional place-holder xml should be injected if the node has to be completed. The key is the node name, and the value the xml to be injected
Returns
The repaired xml