00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_TARGET_COMMITLOG_H 00013 #define ZYPP_TARGET_COMMITLOG_H 00014 00015 #include <iosfwd> 00016 00017 #include "zypp/Pathname.h" 00018 00019 namespace zypp { 00020 namespace target { 00021 00023 // 00024 // CLASS NAME : CommitLog 00042 class CommitLog { 00043 CommitLog( const CommitLog & ); 00044 CommitLog & operator=( const CommitLog & ); 00045 private: 00046 static std::ofstream _log; 00047 static unsigned _refcnt; 00048 static Pathname _fname; 00049 00050 static void openLog(); 00051 static void closeLog(); 00052 static void refUp(); 00053 static void refDown(); 00054 public: 00055 CommitLog() { refUp(); } 00056 ~CommitLog() { refDown(); } 00057 std::ostream & operator()( bool timestamp = false ); 00058 static void setFname( const Pathname & fname_r ); 00059 }; 00061 00062 } // namespace target 00063 } // namespace zypp 00064 00065 00066 #endif // ZYPP_TARGET_COMMITLOG_H
1.5.3