Lines 17-23
Link Here
|
17 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 |
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
18 |
*/ |
18 |
*/ |
19 |
|
19 |
|
20 |
#include <iostream.h> |
20 |
#include <iostream> |
21 |
#include <string.h> |
21 |
#include <string.h> |
22 |
#include <stdio.h> |
22 |
#include <stdio.h> |
23 |
#include <sys/stat.h> |
23 |
#include <sys/stat.h> |
Lines 25-30
Link Here
|
25 |
|
25 |
|
26 |
#include "TailFile.h" |
26 |
#include "TailFile.h" |
27 |
|
27 |
|
|
|
28 |
using namespace std; |
29 |
|
28 |
TailFile::TailFile() |
30 |
TailFile::TailFile() |
29 |
{ |
31 |
{ |
30 |
m_filename = NULL; |
32 |
m_filename = NULL; |
Lines 375-381
Link Here
|
375 |
// check if there isn't a follow buffer |
377 |
// check if there isn't a follow buffer |
376 |
if (m_follow_buffer == NULL) |
378 |
if (m_follow_buffer == NULL) |
377 |
{ |
379 |
{ |
378 |
m_follow_buffer = new ostrstream(); |
380 |
m_follow_buffer = new ostringstream(); |
379 |
} |
381 |
} |
380 |
|
382 |
|
381 |
// make buffer |
383 |
// make buffer |
Lines 454-460
Link Here
|
454 |
m_follow_buffer->put('\0'); |
456 |
m_follow_buffer->put('\0'); |
455 |
|
457 |
|
456 |
// get the string |
458 |
// get the string |
457 |
char *str = m_follow_buffer->str(); |
459 |
const char *str = m_follow_buffer->str().c_str(); |
458 |
|
460 |
|
459 |
// print the line |
461 |
// print the line |
460 |
print_to_stdout(str); |
462 |
print_to_stdout(str); |
Lines 560-566
Link Here
|
560 |
// delete buf; |
562 |
// delete buf; |
561 |
} |
563 |
} |
562 |
|
564 |
|
563 |
void TailFile::print_to_stdout(char *str) |
565 |
void TailFile::print_to_stdout(const char *str) |
564 |
{ |
566 |
{ |
565 |
// checks if there is a colorizer. If so the string is colorized |
567 |
// checks if there is a colorizer. If so the string is colorized |
566 |
// before it's printed. If not the string isn't colorized. |
568 |
// before it's printed. If not the string isn't colorized. |
Lines 575-581
Link Here
|
575 |
if (m_colorizer) |
577 |
if (m_colorizer) |
576 |
{ |
578 |
{ |
577 |
// colorize the string |
579 |
// colorize the string |
578 |
char *buf = m_colorizer->colorize(str); |
580 |
const char *buf = m_colorizer->colorize(str); |
579 |
// print the new colorized string |
581 |
// print the new colorized string |
580 |
cout << buf; |
582 |
cout << buf; |
581 |
// free the mem |
583 |
// free the mem |