7 #ifndef LIBPKG_BOOT_OPTIONS_FILE
8 #define LIBPKG_BOOT_OPTIONS_FILE
26 std::string _read_pathname;
27 std::string _write_pathname;
28 const char *_section_prefix;
29 const char *_section_version;
30 const char *_section_suffix;
32 const char *_command2;
36 std::vector<std::string> _apps;
37 std::string _boot_drive;
41 boot_options_file(
const char *file_name,
const char *section_prefix,
const char *section_version,
const char *section_suffix,
const char *command,
const char *command2 = 0);
47 bool contains(
const std::string &app)
const;
48 bool add(
const std::string &app);
49 bool remove(
const std::string &app);
50 bool replace(
const std::string &was_app,
const std::string &app);
72 char *
find_section(
const char *name,
const char *suffix);
74 bool parse_word(
char *&pos, std::string &word)
const;
82 public std::runtime_error
102 if (!found) found =
find_section(
"RISCOS !Boot",
"Auto tasks");
121 if (!found) found =
find_section(
"RISCOS BootBoot",
"Boot");
122 if (!found) found =
find_section(
"RISCOS !Boot",
"Auto tasks");
140 char *found =
find_section(
"Acorn BootApps",
"ResApps");
141 if (!found) found =
find_section(
"RISCOS !Boot",
"ResApps");
virtual char * find_insert_section()=0
void rollback()
Discard any changes and reload the file.
Definition: boot_options_file.cc:125
An exception class for reporting failure to commit a boot options file.
Definition: boot_options_file.h:81
Base class to manipulate the RISC OS boot options files in Choices.
Definition: boot_options_file.h:20
virtual char * find_insert_section()
Definition: boot_options_file.h:118
add_to_apps_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:135
bool contains_raw(const std::string &app) const
Check if exact name is contained in the look ups.
Definition: boot_options_file.cc:369
std::string name_in_section(const std::string &app) const
Generate the name used in the file.
Definition: boot_options_file.cc:546
void use_test_pathname(const std::string &pathname)
Change the path name for read or write.
Definition: boot_options_file.cc:265
commit_error()
Construct commit error.
Definition: boot_options_file.cc:574
char * find_section_end(char *section) const
Find the end of the section.
Definition: boot_options_file.cc:511
const std::string & read_pathname() const
The path name to the location of the PreDesk file that contains the look at declarations for reading...
Definition: boot_options_file.h:56
char * next_line(char *line) const
Return adress of start of next line.
Definition: boot_options_file.cc:530
bool parse_word(char *&pos, std::string &word) const
Parse a single word from the given location.
Definition: boot_options_file.cc:450
bool modified() const
Definition: boot_options_file.h:65
Class to configure the add to apps option section in the PreDeskop file.
Definition: boot_options_file.h:131
bool contains(const std::string &app) const
Check if application is contained in the look ups.
Definition: boot_options_file.cc:285
bool add(const std::string &app)
Add application to up section.
Definition: boot_options_file.cc:301
virtual ~boot_options_file()
Definition: boot_options_file.cc:115
bool has_section() const
See if file has the section defined.
Definition: boot_options_file.cc:274
Class to configure the run options in the Desktop file.
Definition: boot_options_file.h:110
char * find_section(const char *name, const char *suffix)
Find section in the file.
Definition: boot_options_file.cc:472
void commit()
Commit any changes to the file.
Definition: boot_options_file.cc:153
virtual ~run_options()
Definition: boot_options_file.h:115
look_at_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:96
const std::string & write_pathname() const
The path name to the location of the PreDesk file that any changes to the look at declarations will b...
Definition: boot_options_file.h:61
void parse_section()
Parse section we are interested into C++ structures.
Definition: boot_options_file.cc:381
virtual char * find_insert_section()
Definition: boot_options_file.h:99
bool replace(const std::string &was_app, const std::string &app)
Replace an application.
Definition: boot_options_file.cc:344
run_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:114
virtual ~look_at_options()
Definition: boot_options_file.h:97
virtual char * find_insert_section()
Definition: boot_options_file.h:138
Class to configure the look at options file in the Desktop file.
Definition: boot_options_file.h:92
void dump_apps() const
Dump apps array to cout - debugging helper.
Definition: boot_options_file.cc:566
boot_options_file(const char *file_name, const char *section_prefix, const char *section_version, const char *section_suffix, const char *command, const char *command2=0)
Construct boot_options_file object by setting parameters for the options file it will edit...
Definition: boot_options_file.cc:97