00001 #ifndef _MAIN_HELPERS_H_ 00002 #define _MAIN_HELPERS_H_ 00003 00004 // C++ headers 00005 #include <iostream> 00006 #include <fstream> 00007 using namespace std; 00008 00009 class MythBackendCommandLineParser; 00010 class QString; 00011 class QSize; 00012 00013 bool setupTVs(bool ismaster, bool &error); 00014 void cleanup(void); 00015 int handle_command(const MythBackendCommandLineParser &cmdline); 00016 int connect_to_master(void); 00017 void print_warnings(const MythBackendCommandLineParser &cmdline); 00018 int run_backend(MythBackendCommandLineParser &cmdline); 00019 00020 namespace 00021 { 00022 class CleanupGuard 00023 { 00024 public: 00025 typedef void (*CleanupFunc)(); 00026 00027 public: 00028 CleanupGuard(CleanupFunc cleanFunction) : 00029 m_cleanFunction(cleanFunction) {} 00030 00031 ~CleanupGuard() 00032 { 00033 m_cleanFunction(); 00034 } 00035 00036 private: 00037 CleanupFunc m_cleanFunction; 00038 }; 00039 } 00040 00041 #endif // _MAIN_HELPERS_H_
1.6.3