feisty meow concerns codebase  2.140
configuration::application_configuration Class Reference

Defines installation-specific locations in the file system. More...

#include <application_configuration.h>

Inheritance diagram for configuration::application_configuration:
Collaboration diagram for configuration::application_configuration:

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::astringvirtual_unix_root ()
 returns the path to the unix root, which may be simulated. More...
 
static const basis::astringGLOBAL_SECTION_NAME ()
 the root section name for our configuration items in the main ini file. More...
 
static const basis::astringLOGGING_FOLDER_NAME ()
 the tag used for finding our logging path in the paths config file. More...
 
static const basis::astringDEFAULT_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...
 

Detailed Description

Defines installation-specific locations in the file system.

Definition at line 24 of file application_configuration.h.

Constructor & Destructor Documentation

◆ ~application_configuration()

virtual configuration::application_configuration::~application_configuration ( )
inlinevirtual

Definition at line 27 of file application_configuration.h.

Member Function Documentation

◆ application_configuration_file()

astring configuration::application_configuration::application_configuration_file ( )
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().

◆ APPLICATION_CONFIGURATION_FILENAME()

static const char* configuration::application_configuration::APPLICATION_CONFIGURATION_FILENAME ( )
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.

◆ application_directory()

astring configuration::application_configuration::application_directory ( )
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().

◆ application_name()

astring configuration::application_configuration::application_name ( )
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.

◆ current_directory()

astring configuration::application_configuration::current_directory ( )
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.

◆ DEFAULT_VIRTUAL_UNIX_ROOT()

const astring & configuration::application_configuration::DEFAULT_VIRTUAL_UNIX_ROOT ( )
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.

◆ get_cmdline_from_proc()

astring configuration::application_configuration::get_cmdline_from_proc ( )
static

◆ get_logging_directory()

astring configuration::application_configuration::get_logging_directory ( )
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().

◆ get_OS_version()

structures::version configuration::application_configuration::get_OS_version ( )
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.

◆ GLOBAL_SECTION_NAME()

const astring & configuration::application_configuration::GLOBAL_SECTION_NAME ( )
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.

◆ LOGGING_FOLDER_NAME()

const astring & configuration::application_configuration::LOGGING_FOLDER_NAME ( )
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.

◆ make_logfile_name()

astring configuration::application_configuration::make_logfile_name ( const basis::astring base_name)
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().

◆ process_id()

basis::un_int configuration::application_configuration::process_id ( )
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.

◆ query_for_process_info()

astring configuration::application_configuration::query_for_process_info ( )
static

◆ read_item()

astring configuration::application_configuration::read_item ( const basis::astring key_name)
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().

◆ software_product_name()

const char * configuration::application_configuration::software_product_name ( )
static

This global function is available to the system at large for branding info.

Definition at line 251 of file application_configuration.cpp.

◆ virtual_unix_root()

const astring & configuration::application_configuration::virtual_unix_root ( )
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.


The documentation for this class was generated from the following files: