E-MailRelay
Classes | Public Member Functions | Static Public Member Functions | List of all members
G::BatchFile Class Reference

A class for reading and writing windows-style startup batch files containing a single command-line, optionally using "start". More...

#include <gbatchfile.h>

Classes

struct  NoThrow
 Overload discriminator for G::BatchFile. More...
 

Public Member Functions

 BatchFile (const G::Path &)
 Constructor that reads from a file.
 
 BatchFile (const G::Path &, NoThrow)
 Constructor that reads from a file that might be missing or empty. More...
 
 BatchFile (std::istream &, const std::string &stream_name=std::string())
 Constructor that reads from a stream.
 
std::string line () const
 Returns the main command-line from within the batchfile, with normalised spaces, without any "start" prefix, and including quotes. More...
 
std::string name () const
 Returns the "start" window name, if any.
 
const G::StringArray & args () const
 Returns the startup command-line broken up into de-quoted pieces. More...
 

Static Public Member Functions

static void write (const G::Path &, const StringArray &args, const std::string &start_window_name=std::string())
 Writes a startup batch file, including a "start" prefix. More...
 

Detailed Description

A class for reading and writing windows-style startup batch files containing a single command-line, optionally using "start".

Definition at line 41 of file gbatchfile.h.

Constructor & Destructor Documentation

G::BatchFile::BatchFile ( const G::Path &  path,
NoThrow   
)

Constructor that reads from a file that might be missing or empty.

Definition at line 38 of file gbatchfile.cpp.

Member Function Documentation

const G::StringArray & G::BatchFile::args ( ) const

Returns the startup command-line broken up into de-quoted pieces.

The first item in the list will be the executable.

Definition at line 148 of file gbatchfile.cpp.

std::string G::BatchFile::line ( ) const

Returns the main command-line from within the batchfile, with normalised spaces, without any "start" prefix, and including quotes.

Definition at line 138 of file gbatchfile.cpp.

void G::BatchFile::write ( const G::Path &  path,
const StringArray &  args,
const std::string &  start_window_name = std::string() 
)
static

Writes a startup batch file, including a "start" prefix.

If the "start" window name is not supplied then it is derived from the command-line.

Definition at line 159 of file gbatchfile.cpp.


The documentation for this class was generated from the following files: