52 G_EXCEPTION( Error ,
tx(
"batch file error") ) ;
61 explicit BatchFile( std::istream & ,
const std::string & stream_name = {} ) ;
64 std::string
line()
const ;
68 std::string
name()
const ;
79 const std::string & start_window_name = {} ) ;
87 static std::string quote(
const std::string & ) ;
88 static std::string percents(
const std::string & ) ;
89 static void dequote( std::string & ) ;
90 std::string readFrom( std::istream & ,
const std::string & ,
bool ) ;
92 static bool ignorable(
const std::string &
line ) ;
93 static bool relevant(
const std::string &
line ) ;
94 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 &new_batch_file, const StringArray &args, const std::string &start_window_name={})
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.
constexpr const char * tx(const char *p)
A briefer alternative to G::gettext_noop().