Functions | |
| const char * | PATH_CONFIGURATION_FILENAME () |
| the configuration file provides a set of paths needed here. | |
| istring | path_configuration_file () |
| the fully specified path to the main path configuration file. | |
| const istring & | GLOBAL_SECTION_NAME () |
| the root section name for our configuration items in the main ini file. | |
| const istring & | LOCAL_FOLDER_NAME () |
| entry name in the config file that points at the installation root. | |
| const istring & | LOGGING_FOLDER_NAME () |
| the location where the log files for the system are stored. | |
| istring | installation_root () |
| returns the top-level directory of this installation. | |
| istring | get_logging_directory () |
| returns the directory where log files will be stored. | |
| istring | make_logfile_name (const istring &base_name) |
| generates an installation appropriate log file name from "base_name". | |
| void | hard_code_application_name (const istring &new_name) |
| forces the name for this program to be "new_name". | |
| istring | application_name () |
| returns the name of "this" program. | |
| void | hard_code_application_dir (const istring &new_dir) |
| forces the application_directory() method to always return "new_dir". | |
| istring | application_directory () |
| returns the directory name where this application is running from. | |
| istring | core_bin_directory () |
| retrieves the core binary directory location from paths.ini. | |
| istring | read_item (const istring &key_name) |
| returns the entry listed under the "key_name". | |
Variables | |
| const int | MAX_LOG_PATH = 200 |
| istring OSFUNC path_configuration::application_directory | ( | ) |
returns the directory name where this application is running from.
Definition at line 135 of file path_configuration.cpp.
References application_name().
Referenced by main(), ini_configurator::name(), path_configuration_file(), and smtp_client::send_email().
| istring OSFUNC path_configuration::application_name | ( | ) |
returns the name of "this" program.
Definition at line 124 of file path_configuration.cpp.
References portable::application_name().
Referenced by app_name_for_file_logger(), application_directory(), and anchor_window::launch().
| istring OSFUNC path_configuration::core_bin_directory | ( | ) |
retrieves the core binary directory location from paths.ini.
Definition at line 143 of file path_configuration.cpp.
References read_item().
| istring OSFUNC path_configuration::get_logging_directory | ( | ) |
returns the directory where log files will be stored.
Definition at line 73 of file path_configuration.cpp.
References ini_configurator::APPLICATION_DIRECTORY, GLOBAL_SECTION_NAME(), installation_root(), LOGGING_FOLDER_NAME(), mkdir, istring::observe(), path_configuration_file(), read_item(), configurator::RETURN_ONLY, istring::s(), S_IFDIR, stat, configurator::store(), and parser_bits::substitute_env_vars().
Referenced by default_critical_location(), and make_logfile_name().
| const istring OSFUNC & path_configuration::GLOBAL_SECTION_NAME | ( | ) |
the root section name for our configuration items in the main ini file.
within the configuration file, there is a section named as above. this section should only be used to define path configuration entries that affect the general operation of the system. entries that are specific to particular programs or subsystems should be contained in their own section.
Definition at line 51 of file path_configuration.cpp.
References STATIC_STRING.
Referenced by get_logging_directory(), and read_item().
| void OSFUNC path_configuration::hard_code_application_dir | ( | const istring & | new_dir | ) |
forces the application_directory() method to always return "new_dir".
this can be changed during runtime but that would lead to some odd results; it is recommended that this facility never be used except by programs which do not live with the rest of the installed applications.
Definition at line 132 of file path_configuration.cpp.
| void OSFUNC path_configuration::hard_code_application_name | ( | const istring & | new_name | ) |
forces the name for this program to be "new_name".
this allows specification of the application name in cases where it is not correct or appropriate (such as applications that run as plugins to other applications). after this is called, the application_name() method will return the "new_name".
Definition at line 121 of file path_configuration.cpp.
| istring OSFUNC path_configuration::installation_root | ( | ) |
returns the top-level directory of this installation.
returns the folder containing the application directory (usually) as well as the other folders of configuration information and fonts and such needed by this installation.
Definition at line 62 of file path_configuration.cpp.
References LOCAL_FOLDER_NAME(), path_configuration_file(), and read_item().
Referenced by get_logging_directory().
| const istring OSFUNC & path_configuration::LOCAL_FOLDER_NAME | ( | ) |
entry name in the config file that points at the installation root.
this is where all files for this product are stored on "this" machine.
Definition at line 53 of file path_configuration.cpp.
References STATIC_STRING.
Referenced by installation_root().
| const istring OSFUNC & path_configuration::LOGGING_FOLDER_NAME | ( | ) |
the location where the log files for the system are stored.
this is always considered to be a directory under the local folder. the make_logfile_name() function (see below) can be used to create a properly formed filename for logging.
Definition at line 55 of file path_configuration.cpp.
References STATIC_STRING.
Referenced by get_logging_directory().
generates an installation appropriate log file name from "base_name".
creates and returns a full path name for a log file with the "base_name" specified, using the LOGGING_FOLDER_NAME() entry as the directory name. if the logging directory does not exist, it is created if that is possible. the returned name is suitable for logging mechanisms that need a filename. an empty string is returned on failure to create the directory.
Definition at line 116 of file path_configuration.cpp.
References base_name(), and get_logging_directory().
Referenced by app_name_for_file_logger(), main(), and hoople_api::low_level_methods::make_logfile_name().
| istring OSFUNC path_configuration::path_configuration_file | ( | ) |
the fully specified path to the main path configuration file.
the location of this file is determined by the directory where this executable is running. this is the only configuration file that should reside there, given the itchy vista compliance needs.
Definition at line 44 of file path_configuration.cpp.
References application_directory(), PATH_CONFIGURATION_FILENAME(), and filename::raw().
Referenced by get_logging_directory(), installation_root(), and read_item().
| const char OSFUNC * path_configuration::PATH_CONFIGURATION_FILENAME | ( | ) |
the configuration file provides a set of paths needed here.
this file stores paths that the low-level libraries need for proper operation. this is just the base filename; the fully qualified path to the path configuration file is provided below.
Definition at line 42 of file path_configuration.cpp.
Referenced by path_configuration_file().
returns the entry listed under the "key_name".
if the "key_name" is valid for the root configuration file, then this should always return an appropriate value. a failure is denoted by return of an empty string.
Definition at line 145 of file path_configuration.cpp.
References ini_configurator::APPLICATION_DIRECTORY, GLOBAL_SECTION_NAME(), configurator::load(), path_configuration_file(), configurator::RETURN_ONLY, and parser_bits::substitute_env_vars().
Referenced by core_bin_directory(), get_logging_directory(), and installation_root().
| const int path_configuration::MAX_LOG_PATH = 200 |
Definition at line 59 of file path_configuration.cpp.
1.5.1