]> git.saurik.com Git - wxWidgets.git/blame - interface/wx/protocol/log.h
abandon attempts to make wxAnyStrPtr behave as bool: user-defined logical operators...
[wxWidgets.git] / interface / wx / protocol / log.h
CommitLineData
0576cd9e
VZ
1///////////////////////////////////////////////////////////////////////////////
2// Name: wx/protocol/log.h
3// Purpose: interface of wxProtocolLog
4// Author: Vadim Zeitlin
5// Created: 2009-03-06
6// RCS-ID: $Id$
7// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
8// Licence: wxWindows licence
9///////////////////////////////////////////////////////////////////////////////
10
11/**
12 Class allowing to log network operations performed by wxProtocol.
13
14 @library{wxnet}
15 @category{net}
16
17 @see wxProtocol
18*/
19class wxProtocolLog
20{
21public:
22 /**
23 Create object doing the logging using wxLogTrace() with the specified
24 trace mask.
25
26 If you override DoLogString() in your class the @a traceMask may be
27 left empty but it must have a valid value if you rely on the default
28 DoLogString() implementation.
29 */
30 wxProtocolLog(const wxString& traceMask);
31
32 /**
33 Called by wxProtocol-derived objects to log strings sent to the server.
34
35 Default implementation prepends a client-to-server marker to @a str and
36 calls DoLogString().
37 */
38 virtual void LogRequest(const wxString& str);
39
40 /**
41 Called by wxProtocol-derived objects to log strings received from the
42 server.
43
44 Default implementation prepends a server-to-client marker to @a str and
45 calls DoLogString().
46 */
47 virtual void LogResponse(const wxString& str);
48
49protected:
50 /**
51 Log the given string.
52
53 This function is called from LogRequest() and LogResponse() and by
54 default uses wxLogTrace() with the trace mask specified in the
55 constructor but can be overridden to do something different by the
56 derived classes.
57 */
58 virtual void DoLogString(const wxString& str);
59};
60
61