E-MailRelay
|
A class for reading and writing windows-style startup batch files containing a single command-line, optionally using "start". More...
#include <gbatchfile.h>
Public Member Functions | |
BatchFile (const Path &) | |
Constructor that reads from a file. More... | |
BatchFile (const Path &, std::nothrow_t) | |
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. More... | |
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. More... | |
const StringArray & | args () const |
Returns the startup command-line broken up into de-quoted pieces. More... | |
std::size_t | lineArgsPos () const |
Returns the position in line() where the arguments start. More... | |
Static Public Member Functions | |
static void | write (const Path &, const StringArray &args, const std::string &start_window_name=std::string()) |
Writes a startup batch file, including a "start" prefix. More... | |
A class for reading and writing windows-style startup batch files containing a single command-line, optionally using "start".
Definition at line 42 of file gbatchfile.h.
|
explicit |
Constructor that reads from a file.
Definition at line 31 of file gbatchfile.cpp.
G::BatchFile::BatchFile | ( | const Path & | path, |
std::nothrow_t | |||
) |
Constructor that reads from a file that might be missing or empty.
Definition at line 41 of file gbatchfile.cpp.
|
explicit |
Constructor that reads from a stream.
Definition at line 52 of file gbatchfile.cpp.
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 150 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 140 of file gbatchfile.cpp.
std::size_t G::BatchFile::lineArgsPos | ( | ) | const |
Returns the position in line() where the arguments start.
Definition at line 155 of file gbatchfile.cpp.
std::string G::BatchFile::name | ( | ) | const |
Returns the "start" window name, if any.
Definition at line 145 of file gbatchfile.cpp.
|
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 190 of file gbatchfile.cpp.