Classes | Namespaces | Functions
utilities.h File Reference

Main module of project-independent BASIS utilities. More...

#include <string>
#include <iostream>
#include <vector>
#include <basis/config.h>
#include "assert.h"
#include "except.h"
#include "os.h"
#include "CmdLine.h"
+ Include dependency graph for utilities.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  basis::util::IExecutableTargetInfo
 Provides information about executable build targets. More...
 
class  basis::util::SubprocessError
 Exception type thrown by execute(). More...
 

Namespaces

 basis
 
 basis::util
 

Functions

int basis::util::execute (const std::string &cmd, bool quiet=false, std::ostream *out=NULL, bool allow_fail=false, int verbose=0, bool simulate=false, const IExecutableTargetInfo *targets=NULL)
 Execute command as subprocess. More...
 
int basis::util::execute (std::vector< std::string > args, bool quiet=false, std::ostream *out=NULL, bool allow_fail=false, int verbose=0, bool simulate=false, const IExecutableTargetInfo *targets=NULL)
 Execute command as subprocess. More...
 
std::string basis::util::exedir (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get directory of executable file. More...
 
std::string basis::util::exename (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get name of executable file. More...
 
std::string basis::util::exepath (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get absolute path of executable file. More...
 
bool basis::util::istarget (const std::string &name, const IExecutableTargetInfo *targets=NULL)
 Determine whether a given build target is known. More...
 
void basis::util::print_contact (const char *contact)
 Print contact information. More...
 
void basis::util::print_version (const char *name, const char *version, const char *project=NULL, const char *copyright=NULL, const char *license=NULL)
 Print version information including copyright and license notices. More...
 
std::vector< std::string > basis::util::qsplit (const std::string &args)
 Split quoted string. More...
 
std::string basis::util::targetuid (const std::string &name, const IExecutableTargetInfo *targets=NULL)
 Get UID of build target. More...
 
std::string basis::util::tostring (const std::vector< std::string > &args)
 Convert array of arguments to quoted string. More...
 

Detailed Description

Main module of project-independent BASIS utilities.

This module defines project-independent implementations of the BASIS utility functions. They are intended for use outside a BASIS-based project only. Within source code of a BASIS-based project, the overloads declared by the basis.h module should be used instead as these are specifically configured by BASIS for this project during the build of the software.

Note that this module includes all other BASIS utility header files. Hence, it is sufficient to include this file only.

Definition in file utilities.h.