19 #ifndef LIBPKG_BOOT_OPTIONS_FILE 20 #define LIBPKG_BOOT_OPTIONS_FILE 38 std::string _read_pathname;
39 std::string _write_pathname;
40 const char *_section_prefix;
41 const char *_section_version;
42 const char *_section_suffix;
44 const char *_command2;
48 std::vector<std::string> _apps;
49 std::string _boot_drive;
53 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);
59 bool contains(
const std::string &app)
const;
60 bool add(
const std::string &app);
61 bool remove(
const std::string &app);
62 bool replace(
const std::string &was_app,
const std::string &app);
84 char *
find_section(
const char *name,
const char *suffix);
86 bool parse_word(
char *&pos, std::string &word)
const;
94 public std::runtime_error
114 if (!found) found =
find_section(
"RISCOS !Boot",
"Auto tasks");
133 if (!found) found =
find_section(
"RISCOS BootBoot",
"Boot");
134 if (!found) found =
find_section(
"RISCOS !Boot",
"Auto tasks");
152 char *found =
find_section(
"Acorn BootApps",
"ResApps");
153 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:135
An exception class for reporting failure to commit a boot options file.
Definition: boot_options_file.h:93
bool modified() const
Definition: boot_options_file.h:77
Base class to manipulate the RISC OS boot options files in Choices.
Definition: boot_options_file.h:32
virtual char * find_insert_section()
Definition: boot_options_file.h:130
add_to_apps_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:147
The namespace used to hold the package management library.
Definition: auto_dir.cc:23
void use_test_pathname(const std::string &pathname)
Change the path name for read or write.
Definition: boot_options_file.cc:275
std::string name_in_section(const std::string &app) const
Generate the name used in the file.
Definition: boot_options_file.cc:556
bool parse_word(char *&pos, std::string &word) const
Parse a single word from the given location.
Definition: boot_options_file.cc:460
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:68
Class to configure the add to apps option section in the PreDeskop file.
Definition: boot_options_file.h:143
bool add(const std::string &app)
Add application to up section.
Definition: boot_options_file.cc:311
virtual ~boot_options_file()
Definition: boot_options_file.cc:125
char * find_section_end(char *section) const
Find the end of the section.
Definition: boot_options_file.cc:521
bool has_section() const
See if file has the section defined.
Definition: boot_options_file.cc:284
Class to configure the run options in the Desktop file.
Definition: boot_options_file.h:122
void dump_apps() const
Dump apps array to cout - debugging helper.
Definition: boot_options_file.cc:576
char * find_section(const char *name, const char *suffix)
Find section in the file.
Definition: boot_options_file.cc:482
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:73
char * next_line(char *line) const
Return adress of start of next line.
Definition: boot_options_file.cc:540
void commit()
Commit any changes to the file.
Definition: boot_options_file.cc:163
virtual ~run_options()
Definition: boot_options_file.h:127
look_at_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:108
void parse_section()
Parse section we are interested into C++ structures.
Definition: boot_options_file.cc:391
bool contains(const std::string &app) const
Check if application is contained in the look ups.
Definition: boot_options_file.cc:295
virtual char * find_insert_section()
Definition: boot_options_file.h:111
bool replace(const std::string &was_app, const std::string &app)
Replace an application.
Definition: boot_options_file.cc:354
run_options()
Constructor sets up base class with the correct values for the look at options.
Definition: boot_options_file.h:126
virtual ~look_at_options()
Definition: boot_options_file.h:109
virtual char * find_insert_section()
Definition: boot_options_file.h:150
Class to configure the look at options file in the Desktop file.
Definition: boot_options_file.h:104
bool contains_raw(const std::string &app) const
Check if exact name is contained in the look ups.
Definition: boot_options_file.cc:379
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:107