BASIS  r3148
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

namespace  basis
namespace  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.
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.
std::string basis::util::exedir (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get directory of executable file.
std::string basis::util::exename (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get name of executable file.
std::string basis::util::exepath (const std::string &name=std::string(), const IExecutableTargetInfo *targets=NULL)
 Get absolute path of executable file.
bool basis::util::istarget (const std::string &name, const IExecutableTargetInfo *targets=NULL)
 Determine whether a given build target is known.
void basis::util::print_contact (const char *contact)
 Print contact information.
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.
std::vector< std::string > basis::util::qsplit (const std::string &args)
 Split quoted string.
std::string basis::util::targetuid (const std::string &name, const IExecutableTargetInfo *targets=NULL)
 Get UID of build target.
std::string basis::util::tostring (const std::vector< std::string > &args)
 Convert array of arguments to quoted string.

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.

Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.

Contact: SBIA Group <sbia-software at uphs.upenn.edu>

Definition in file utilities.h.