]> git.saurik.com Git - wxWidgets.git/blame - utils/HelpGen/src/ifcontext.h
rebaked after changing the version number
[wxWidgets.git] / utils / HelpGen / src / ifcontext.h
CommitLineData
cecfc5e7
VZ
1/////////////////////////////////////////////////////////////////////////////
2// Name: No names yet.
3// Purpose: Contrib. demo
4// Author: Aleksandras Gluchovas
5// Modified by:
6// Created: 27/12/98
7// RCS-ID: $Id$
8// Copyright: (c) Aleskandars Gluchovas
fa1af598 9// Licence: wxWindows licence
cecfc5e7
VZ
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef __IFCONTEXT_G__
13#define __IFCONTEXT_G__
14
15#include "srcparser.h"
16#include "cjparser.h"
17
18class spBookmark
19{
20public:
fa1af598
WS
21 size_t mFrom;
22 size_t mLen;
23 size_t mFileNo;
cecfc5e7 24
fa1af598 25 inline spBookmark() {}
cecfc5e7 26
fa1af598
WS
27 inline spBookmark( int from, int len, int fileNo )
28 : mFrom( from ), mLen( len ), mFileNo( fileNo )
29 {}
cecfc5e7
VZ
30};
31
32#if defined( wxUSE_TEMPLATE_STL )
33
fa1af598 34 typedef vector<spBookmark) BookmarkListT
cecfc5e7
VZ
35
36#else
37
fa1af598 38 typedef WXSTL_VECTOR_SHALLOW_COPY(spBookmark) BookmarkListT;
cecfc5e7
VZ
39
40#endif
41
42
43class spInterFileContext : public spContext
44{
45protected:
46
fa1af598 47 BookmarkListT mDeletionMarks;
cecfc5e7 48
fa1af598 49 BookmarkListT mFiltered;
cecfc5e7 50
fa1af598 51 size_t mCurFileNo;
cecfc5e7 52
fa1af598 53 CJSourceParser mParser;
cecfc5e7
VZ
54
55protected:
56
fa1af598 57 size_t GetFileNoOfContext( spContext& ctx );
60ec1c87 58 size_t GetFileNo( const wxString& fname );
cecfc5e7 59
fa1af598 60 void InsertBookmarkSorted( BookmarkListT& lst, spBookmark& mark );
cecfc5e7 61
7942245d
WS
62 void DoAppendSourceFragment( wxString& source,
63 wxString& result,
64 size_t pos,
65 size_t len );
cecfc5e7 66
60ec1c87 67 void GenerateContextBody( spContext& ctx,
7942245d
WS
68 wxString& source,
69 wxString& result,
70 size_t& lastSavedPos,
71 size_t& lastKnownPos );
cecfc5e7
VZ
72
73public:
74
60ec1c87
WS
75 StrListT m_Files;
76 StrListT m_Contents;
cecfc5e7
VZ
77
78public:
79
fa1af598 80 spInterFileContext();
d3c7fc99 81 virtual ~spInterFileContext();
cecfc5e7 82
60ec1c87 83 void AddFile( const wxString& fname, const wxString& content );
cecfc5e7 84
fa1af598 85 void RemoveContext( spContext& ctx );
cecfc5e7 86
fa1af598 87 void GenrateContents();
cecfc5e7 88
fa1af598 89 void ParseContents( SourceParserPlugin* pPlugin = NULL );
cecfc5e7 90
fa1af598 91 void WriteToFiles();
cecfc5e7 92
fa1af598 93 // overriden method of the base class (finds out the source fragment)
cecfc5e7 94
fa1af598 95 virtual wxString GetBody( spContext* pCtx = NULL );
cecfc5e7 96
fa1af598 97 virtual wxString GetHeader( spContext* pCtx = NULL );
cecfc5e7
VZ
98};
99
100
753287c1 101#endif