Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

LogBrowser.h

Go to the documentation of this file.
00001 00029 #ifndef LOGBROWSER_H 00030 #define LOGBROWSER_H 00031 00032 #include <string> 00033 #include <iostream> 00034 #include <fstream> 00035 #include <list> 00036 00037 #include "BP_CosLw_Log.h" 00038 #include "LogState.h" 00039 #include "LogRecordFilter.h" 00040 00054 class LogBrowser 00055 { 00056 public: 00057 00064 LogBrowser(LogState& log_state); 00065 00070 ~LogBrowser(); 00071 00083 CosLwLog::RecordId find_by_time(const CosLwLog::LogTime& mark); 00084 00094 void prepare(const CosLwLog::RecordId& start_rec); 00095 00105 CosLwLog::RecordId load_records( 00106 std::list<CosLwLog::LogRecord>& cont, 00107 const CORBA::ULong& maximum, 00108 const LogRecordFilter& filter 00109 ); 00110 00111 00112 private: 00113 00115 std::ifstream _log; 00116 00118 std::string _log_name; 00119 00121 LogState& _log_state; 00122 00124 IdxRecordId::IdxRecord _current_state; 00125 00136 CosLwLog::LogRecord _parse_recd(std::string& recd_line); 00137 00146 void _parse_producer_id(std::string& text, CosLwLog::LogRecord& recd); 00147 00156 void _parse_producer_name(std::string& text, CosLwLog::LogRecord& recd); 00157 00166 void _parse_log_time(std::string& text, CosLwLog::LogRecord& recd); 00167 00176 void _parse_log_level(std::string& text, CosLwLog::LogRecord& recd); 00177 00186 void _parse_log_data(std::string& text, CosLwLog::LogRecord& recd); 00187 00194 bool _is_bounded(const CosLwLog::RecordId& rec_id); 00195 00203 bool _open_log(const std::string& name); 00204 00213 std::ios::pos_type _position(const CosLwLog::RecordId& rec_id); 00214 00215 }; 00216 00217 #endif