feisty meow concerns codebase
2.140
|
Defines installation-specific locations in the file system. More...
#include <application_configuration.h>
Public Member Functions | |
virtual | ~application_configuration () |
Static Public Member Functions | |
static basis::astring | application_name () |
returns the full name of the current application. More... | |
static basis::astring | application_directory () |
returns the directory name where this application is running from. More... | |
static basis::un_int | process_id () |
returns the process id for this task, if that's relevant on the OS. More... | |
static structures::version | get_OS_version () |
returns the operating system's version information. More... | |
static basis::astring | current_directory () |
returns the current directory as reported by the operating system. More... | |
static const char * | software_product_name () |
This global function is available to the system at large for branding info. More... | |
static const char * | APPLICATION_CONFIGURATION_FILENAME () |
< returns the top-level directory of this installation. More... | |
static basis::astring | application_configuration_file () |
the fully specified path to the main path configuration file. More... | |
static basis::astring | get_logging_directory () |
< retrieves the core binary directory location from paths.ini. More... | |
static const basis::astring & | virtual_unix_root () |
returns the path to the unix root, which may be simulated. More... | |
static const basis::astring & | GLOBAL_SECTION_NAME () |
the root section name for our configuration items in the main ini file. More... | |
static const basis::astring & | LOGGING_FOLDER_NAME () |
the tag used for finding our logging path in the paths config file. More... | |
static const basis::astring & | DEFAULT_VIRTUAL_UNIX_ROOT () |
default value if we don't find our setting for virtual root. More... | |
static basis::astring | read_item (const basis::astring &key_name) |
returns the entry listed under the "key_name". More... | |
static basis::astring | make_logfile_name (const basis::astring &base_name) |
generates an installation appropriate log file name from "base_name". More... | |
static basis::astring | get_cmdline_from_proc () |
retrieves the command line from the /proc hierarchy on linux. More... | |
static basis::astring | query_for_process_info () |
seeks out process info for a particular process. More... | |
Defines installation-specific locations in the file system.
Definition at line 24 of file application_configuration.h.
|
inlinevirtual |
Definition at line 27 of file application_configuration.h.
|
static |
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 287 of file application_configuration.cpp.
References configuration::PATH_CONFIGURATION_FILENAME(), and filesystem::filename::raw().
|
static |
< 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. 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.
|
static |
returns the directory name where this application is running from.
Definition at line 260 of file application_configuration.cpp.
References filesystem::filename::dirname(), and filesystem::filename::raw().
|
static |
returns the full name of the current application.
Definition at line 198 of file application_configuration.cpp.
References FUNCDEF, MAX_ABS_PATH, and SET_BOGUS_NAME.
|
static |
returns the current directory as reported by the operating system.
Definition at line 232 of file application_configuration.cpp.
References getcwd, and MAX_ABS_PATH.
|
static |
default value if we don't find our setting for virtual root.
this is bound to fail on many occasions if it's actually used on windoze for the default, but if we don't have good information ready, we can't just intuit the virtual unix root; we are not kreskin. the virtual unix environment could be MSYS, Cygwin, or others. Currently, if Cygwin is used during the build process, then the default should never be needed. support for other systems will be added as time permits and users clamor for them.
Definition at line 300 of file application_configuration.cpp.
References STATIC_STRING.
|
static |
retrieves the command line from the /proc hierarchy on linux.
Definition at line 61 of file application_configuration.cpp.
References basis::astring::end(), FUNCDEF, getline(), filesystem::filename::had_directory(), is_eol(), basis::astring::length(), LOG, basis::negative(), basis::astring::s(), basis::environment::TMP(), unlink, and basis::astring::zap().
|
static |
< retrieves the core binary directory location from paths.ini.
static basis::astring core_bin_directory(); returns the folder where the log files for the feisty meow system are stored. any log files should be written to this folder by the rest of the codebase, unless there are special purposes for those log files. but logs from general operation of feisty meow should be written in this directory.
Definition at line 343 of file application_configuration.cpp.
References filesystem::filename::exists(), LOG, configuration::configurator::store(), and basis::environment::TMP().
|
static |
returns the operating system's version information.
for linux, this has: major/minor/release/revision as components. for ms-windows, this has: major/minor/platform_ID/build_number.
Definition at line 263 of file application_configuration.cpp.
|
static |
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 293 of file application_configuration.cpp.
References STATIC_STRING.
|
static |
the tag used for finding our logging path in the paths config file.
Definition at line 295 of file application_configuration.cpp.
References STATIC_STRING.
|
static |
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 388 of file application_configuration.cpp.
References base_name().
|
static |
returns the process id for this task, if that's relevant on the OS.
Definition at line 226 of file application_configuration.cpp.
References getpid.
|
static |
seeks out process info for a particular process.
Definition at line 137 of file application_configuration.cpp.
References FUNCDEF, mathematics::chaos::inclusive(), LOG, configuration::MAXIMUM_COMMAND_LINE, basis::negative(), rando, basis::astring::reset(), basis::astring::s(), unlink, and basis::astring::UNTERMINATED.
|
static |
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 391 of file application_configuration.cpp.
References configuration::configurator::load().
|
static |
This global function is available to the system at large for branding info.
Definition at line 251 of file application_configuration.cpp.
|
static |
returns the path to the unix root, which may be simulated.
on unix, this will just return '/'. on win32 with cygwin installed, this will return the cygwin path for '/' that was detected at build time. this is often "c:/cygwin", which we use as a default if the path isn't detected properly.
Definition at line 310 of file application_configuration.cpp.