JunkBox_Win_Lib 1.5.3
Loading...
Searching...
No Matches
LogWndDoc.h
Go to the documentation of this file.
1#pragma once
2
3#include <afxmt.h>
4
5#include "ClassBox.h"
6#include "LogRingBuffer.h"
7#include "LogWndView.h"
8
9
10// 最大行数
11#define MAXLOGBUFFERLINE 100000
12
13
14//
15namespace jbxwl {
16
17using namespace jbxl;
18
19
20class CLogWndView;
21class CLogWndFrame;
22
23
24class CLogWndDoc : public CDocument, public CVTextDocument
25{
26protected:
27 CLogWndDoc();
28 CLogWndDoc(int bufsz, BOOL binhex=TRUE);
29
30 DECLARE_DYNCREATE(CLogWndDoc)
31
32public:
33 virtual BOOL OnNewDocument();
34 virtual void Serialize(CArchive& ar);
35
38
39 CString Title;
41
42protected:
43// BOOL m_locked;
44
45public:
46 virtual void lprintBuffer(Buffer buf, int input=LOG_RB_MESG);
47 virtual void lprintString(char* str, int input=LOG_RB_MESG);
48 virtual void lprintFormat(char* fmt, ...);
49 virtual void lfprintFormat(int input, char* fmt, ...);
50
51 virtual void printBuffer(Buffer buf, int input=LOG_RB_MESG);
52 virtual void printString(char* str, int input=LOG_RB_MESG);
53 virtual void printFormat(char* fmt, ...);
54 virtual void fprintFormat(int input, char* fmt, ...);
55
56 virtual void lock(void) { m_locked = TRUE; if (pView!=NULL) pView->lock();}
57 virtual void unlock(void) { m_locked = FALSE; if (pView!=NULL) pView->unlock();}
58
59public:
60 virtual ~CLogWndDoc();
61
62#ifdef _DEBUG
63 virtual void AssertValid() const;
64 virtual void Dump(CDumpContext& dc) const;
65#endif
66
67protected:
68 DECLARE_MESSAGE_MAP()
69
70public:
71 CString save_fname;
72 CLogRingBuffer* ringBuffer;
73 CCriticalSection criticalKey;
74
75public:
76 void free(void);
77 void clear(void);
78 int writeLogFile(void);
79 CString easyGetSaveFileName(LPCTSTR title, HWND hWnd);
80
81 void DeleteContents(void);
82 CLogWndView* GetView(void);
83};
84
85
86} // namespace
CLogRingBuffer * ringBuffer
Definition LogWndDoc.h:72
void DeleteContents(void)
virtual BOOL OnNewDocument()
Definition LogWndDoc.cpp:81
CLogWndView * pView
Definition LogWndDoc.h:37
int writeLogFile(void)
virtual void lprintString(char *str, int input=LOG_RB_MESG)
virtual void lfprintFormat(int input, char *fmt,...)
virtual void unlock(void)
Definition LogWndDoc.h:57
virtual void printBuffer(Buffer buf, int input=LOG_RB_MESG)
CLogWndFrame * pFrame
Definition LogWndDoc.h:36
virtual void lprintBuffer(Buffer buf, int input=LOG_RB_MESG)
virtual void fprintFormat(int input, char *fmt,...)
CLogWndView * GetView(void)
virtual void lprintFormat(char *fmt,...)
CString save_fname
Definition LogWndDoc.h:71
virtual void Serialize(CArchive &ar)
Definition LogWndDoc.cpp:93
CCriticalSection criticalKey
Definition LogWndDoc.h:73
void free(void)
Definition LogWndDoc.cpp:72
virtual void AssertValid() const
CString easyGetSaveFileName(LPCTSTR title, HWND hWnd)
virtual void Dump(CDumpContext &dc) const
virtual void lock(void)
Definition LogWndDoc.h:56
virtual ~CLogWndDoc()
Definition LogWndDoc.cpp:59
virtual void printFormat(char *fmt,...)
virtual void printString(char *str, int input=LOG_RB_MESG)
void unlock(void)
Definition LogWndView.h:36
void lock(void)
Definition LogWndView.h:35