Vidalia
0.3.1
Main Page
Namespaces
Classes
Files
File List
File Members
src
vidalia
log
LogFile.h
Go to the documentation of this file.
1
/*
2
** This file is part of Vidalia, and is subject to the license terms in the
3
** LICENSE file, found in the top level directory of this distribution. If you
4
** did not receive the LICENSE file with this file, you may obtain it from the
5
** Vidalia source package distributed by the Vidalia Project at
6
** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7
** including this file, may be copied, modified, propagated, or distributed
8
** except according to the terms described in the LICENSE file.
9
*/
10
11
/*
12
** \file LogFile.h
13
** \brief Logs messages from Tor to a file
14
*/
15
16
#ifndef _LOGFILE_H
17
#define _LOGFILE_H
18
19
#include <QFile>
20
#include <QObject>
21
#include <QString>
22
#include <QTextStream>
23
24
25
class
LogFile
: QObject
26
{
27
Q_OBJECT
28
29
public
:
30
/** Default constructor. */
31
LogFile
();
32
/** Destructor. */
33
~LogFile
();
34
35
/** Opens a log file for writing. */
36
bool
open
(QString
filename
, QString *errmsg = 0);
37
/** Closes an open log file. */
38
void
close
();
39
40
/** Returns true if the logfile is currently open. */
41
bool
isOpen
();
42
/** Returns the filename of the current log file. */
43
QString
filename
();
44
45
/** Overloaded ostream operator. */
46
LogFile
&
operator<<
(
const
QString &s);
47
48
private
:
49
/** Creates a path to the given log file */
50
bool
createPathToFile
(QString filename);
51
52
QFile*
_file
;
/**< The log file. */
53
QTextStream
_stream
;
/**< Stream used to write to the log file. */
54
};
55
56
#endif
57
Generated on Mon Jan 14 2013 08:44:27 for Vidalia by
1.8.3