45 G_EXCEPTION( Error ,
"batch file error" ) ;
54 explicit BatchFile( std::istream & ,
const std::string & stream_name = std::string() ) ;
57 std::string
line()
const ;
61 std::string
name()
const ;
72 const std::string & start_window_name = std::string() ) ;
78 static std::string quote(
const std::string & ) ;
79 static std::string percents(
const std::string & ) ;
80 static void dequote( std::string & ) ;
81 std::string readFrom( std::istream & ,
const std::string & ,
bool ) ;
83 static bool ignorable(
const std::string &
line ) ;
84 static bool relevant(
const std::string &
line ) ;
85 static std::string join(
const std::string & file_name ,
unsigned int line_number ) ;
A class for reading and writing windows-style startup batch files containing a single command-line,...
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.
const StringArray & args() const
Returns the startup command-line broken up into de-quoted pieces.
std::size_t lineArgsPos() const
Returns the position in line() where the arguments start.
std::string name() const
Returns the "start" window name, if any.
BatchFile(const Path &)
Constructor that reads from a file.
std::string line() const
Returns the main command-line from within the batchfile, with normalised spaces, without any "start" ...
A Path object represents a file system path.
std::vector< std::string > StringArray
A std::vector of std::strings.