application_shell.h

Go to the documentation of this file.
00001 #ifndef APPLICATION_SHELL_CLASS
00002 #define APPLICATION_SHELL_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : application_shell                                                 *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2000-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "application_base.h"
00019 #include "ini_config.h"
00020 
00021 #include <basis/log_base.h>
00022 
00024 
00031 class OPSYSTEM_CLASS_STYLE application_shell : public application_base
00032 {
00033 public:  
00034   enum limits { LOG_FILE_SIZE = 1244688 };
00036 //hmmm: move the limit lower down in class hier since file_logger also has it.
00037 
00038   application_shell(const istring &filename_root, int max_log = LOG_FILE_SIZE,
00039           ini_configurator::file_location_default where
00040               = ini_configurator::ALL_USERS_DIRECTORY);
00042 
00047   virtual ~application_shell();
00048 
00049   virtual int execute() = 0;
00051 
00052   chaos &randomizer() const { return *_rando; }
00054 
00055   istring filename_root() const;
00057 
00062   ini_configurator &ini() const;
00064 
00065   istring ini_name() const;
00067 
00068   istring log_name() const;
00070 
00071   virtual outcome log(const istring &to_print);
00073 
00076   virtual outcome log(const istring &to_print, int filter);
00078 
00082   log_base &logger() const;
00084 
00088   log_base *swap_logger(log_base *new_logger);
00090 
00095   friend application_shell &operator << (application_shell &out,
00096           const istring &to_print);
00098 
00099 private:
00100   chaos *_rando;  
00101   istring *_root_name;  
00102   ini_configurator *_ini;  
00103 
00104   static istring LOG_NAME(const istring &root);
00106 
00107   // not applicable.
00108   application_shell(const application_shell &);
00109   application_shell &operator =(const application_shell &);
00110 };
00111 
00112 #endif // outer guard.
00113 

Generated on Wed Nov 19 04:28:52 2008 for HOOPLE Libraries by  doxygen 1.5.1