1 diff -Naur CfgFileParser.cc.orig CfgFileParser.cc
2 --- CfgFileParser.cc.orig Tue Aug 3 14:40:44 1999
3 +++ CfgFileParser.cc Sat Aug 24 16:03:58 2002
6 #include "CfgFileParser.h"
18 // ## class SearchData ##
24 -int CfgFileParser::parse(char *filename)
25 +int CfgFileParser::parse(const char *filename)
27 // parses the cfg file and sets up the list of SearchData elements
28 // returns number of SearchData items created
29 diff -Naur CfgFileParser.h.orig CfgFileParser.h
30 --- CfgFileParser.h.orig Tue Aug 3 14:40:52 1999
31 +++ CfgFileParser.h Sat Aug 24 16:03:21 2002
34 #include <sys/types.h>
40 #ifdef HAVE_GNUREGEX_H
41 # include <gnuregex.h>
45 List<SearchData*> *m_items_list;
47 + std::ifstream m_infile;
55 - int parse(char *filename);
56 + int parse(const char *filename);
57 List<SearchData*>* get_items_list();
60 diff -Naur ColorTail.cc.orig ColorTail.cc
61 --- ColorTail.cc.orig Tue Aug 3 14:41:02 1999
62 +++ ColorTail.cc Sat Aug 24 15:28:21 2002
64 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
67 -#include <iostream.h>
73 #include "OptionsParser.h"
74 #include "Colorizer.h"
79 ColorTail::ColorTail()
80 diff -Naur Colorizer.cc.orig Colorizer.cc
81 --- Colorizer.cc.orig Tue Aug 3 14:41:17 1999
82 +++ Colorizer.cc Sat Aug 24 16:07:33 2002
88 -#include <strstream.h>
94 Colorizer::Colorizer()
100 -Colorizer::Colorizer(char *cfg_file)
101 +Colorizer::Colorizer(const char *cfg_file)
109 -char* Colorizer::colorize(char *str)
110 +const char* Colorizer::colorize(const char *str)
112 // colorize the string, returns a new string containing
113 // the colorized version of str
115 ListIterator<SearchData*> itr(*m_items_list);
117 // will contain the new string
119 + ostringstream newstr;
124 // write ansi reset str and a newline
125 newstr << ANSI_RESET_STR << endl << ends;
126 // return the new string
127 - return newstr.str();
128 + return newstr.str().c_str();
135 // return the new string
136 - return newstr.str();
137 + return newstr.str().c_str();
140 // did we find submatches?
142 // cout << "DEBUG: " << bla << " END DEBUG" << endl;
145 - return newstr.str();
146 + return newstr.str().c_str();
150 diff -Naur Colorizer.h.orig Colorizer.h
151 --- Colorizer.h.orig Tue Aug 3 14:41:25 1999
152 +++ Colorizer.h Sat Aug 24 16:07:43 2002
157 - Colorizer(char *cfg_file);
158 + Colorizer(const char *cfg_file);
161 - char* colorize(char *str);
162 + const char* colorize(const char *str);
166 diff -Naur Info.cc.orig Info.cc
167 --- Info.cc.orig Tue Aug 3 14:41:38 1999
168 +++ Info.cc Sat Aug 24 15:58:29 2002
170 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
173 -#include <iostream.h>
179 +using namespace std;
184 diff -Naur OptionsParser.cc.orig OptionsParser.cc
185 --- OptionsParser.cc.orig Wed Aug 4 18:23:39 1999
186 +++ OptionsParser.cc Sat Aug 24 15:59:41 2002
188 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
191 -#include <iostream.h>
192 -#include <strstream.h>
202 +using namespace std;
203 // methods for class Options
210 - ostrstream filename;
211 + ostringstream filename;
218 // set filename in options class
219 - o->cfg_filenames[o->nr_cfg_files] = filename.str();
220 + o->cfg_filenames[o->nr_cfg_files] = filename.str().c_str();
222 // increase the nr_cfg_files counter
226 // found end of string
227 // set filename in options class
228 - o->cfg_filenames[o->nr_cfg_files] = filename.str();
229 + o->cfg_filenames[o->nr_cfg_files] = filename.str().c_str();
231 // increase the nr_cfg_files counter
233 diff -Naur OptionsParser.h.orig OptionsParser.h
234 --- OptionsParser.h.orig Wed Aug 4 18:33:08 1999
235 +++ OptionsParser.h Sat Aug 24 16:00:42 2002
240 - char *cfg_filenames[MAX_FILES];
241 + const char *cfg_filenames[MAX_FILES];
245 diff -Naur TailFile.cc.orig TailFile.cc
246 --- TailFile.cc.orig Wed Aug 4 18:09:38 1999
247 +++ TailFile.cc Sat Aug 24 16:08:12 2002
249 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
252 -#include <iostream.h>
256 #include <sys/stat.h>
259 #include "TailFile.h"
261 +using namespace std;
267 // check if there isn't a follow buffer
268 if (m_follow_buffer == NULL)
270 - m_follow_buffer = new ostrstream();
271 + m_follow_buffer = new ostringstream();
276 m_follow_buffer->put('\0');
279 - char *str = m_follow_buffer->str();
280 + const char *str = m_follow_buffer->str().c_str();
283 print_to_stdout(str);
288 -void TailFile::print_to_stdout(char *str)
289 +void TailFile::print_to_stdout(const char *str)
291 // checks if there is a colorizer. If so the string is colorized
292 // before it's printed. If not the string isn't colorized.
296 // colorize the string
297 - char *buf = m_colorizer->colorize(str);
298 + const char *buf = m_colorizer->colorize(str);
299 // print the new colorized string
302 diff -Naur TailFile.h.orig TailFile.h
303 --- TailFile.h.orig Tue Aug 3 14:42:33 1999
304 +++ TailFile.h Sat Aug 24 16:06:00 2002
306 #include "Colorizer.h"
309 -#include <strstream.h>
312 #define MAX_CHARS_READ 1024
315 // the stream position
317 // the follow buffer, used in follow_print
318 - ostrstream *m_follow_buffer;
319 + std::ostringstream *m_follow_buffer;
322 void find_position(int n);
323 long end_of_file_position();
324 - void print_to_stdout(char *str);
325 + void print_to_stdout(const char *str);
329 diff -Naur Usage.cc.orig Usage.cc
330 --- Usage.cc.orig Wed Aug 4 18:44:37 1999
331 +++ Usage.cc Sat Aug 24 16:08:35 2002
333 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
336 -#include <iostream.h>
341 +using namespace std;