WSF
TextSourceCache.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef TEXTSOURCECACHE_HPP
13#define TEXTSOURCECACHE_HPP
14
15#include <map>
16#include <set>
17#include <string>
18
19#include "UtPath.hpp"
20#include "Util.hpp"
22
23class QsciDocument;
24class UtTextDocument;
25class WsfParseNode;
26
27namespace wizard
28{
30class TextSource;
31
35{
36public:
37 explicit TextSourceCache(wizard::ProjectWorkspace* aWorkspacePtr);
39 TextSource* GetSource(const UtPath& aPath, bool aRead = true);
40 TextSource* FindSource(const UtPath& aPath, bool aRead = true);
41 TextSource* FindSource(const std::string& aPath, bool aRead = true);
42 TextSource* FindSource(UtTextDocument* aParseSourcePtr);
43 typedef std::map<std::string, TextSource*, wizard::UtilFileStringCompare> SourceMap;
44 const SourceMap& GetSources() const { return mSources; }
45
46 void DeleteSource(TextSource* aSourcePtr);
47 void Clear();
48 std::set<TextSource*> mNewSources;
49
50protected:
53};
54
57{
58public:
60 : mAllowNewSources(true)
61 , mCachePtr(aCachePtr)
62 {
63 }
64
67 UtTextDocument* FindSource(const UtPath& aPath, bool aReadAccess) override;
68 UtTextDocument* CreateSource(const UtPath& aPath) override;
69};
70} // namespace wizard
71
72#endif
#define VI_EXPORT
Definition ViExport.hpp:38
Definition WsfParseNode.hpp:61
Interface providing source files to the WsfParser.
Definition WsfParseSourceProvider.hpp:24
UtTextDocument * CreateSource(const UtPath &aPath) override
Definition TextSourceCache.cpp:141
UtTextDocument * FindSource(const UtPath &aPath, bool aReadAccess) override
Definition TextSourceCache.cpp:108
bool mAllowNewSources
Definition TextSourceCache.hpp:65
CacheSourceProvider(TextSourceCache *aCachePtr)
Definition TextSourceCache.hpp:59
TextSourceCache * mCachePtr
Definition TextSourceCache.hpp:66
Definition ProjectWorkspace.hpp:48
Definition TextSourceCache.hpp:35
TextSource * GetSource(const UtPath &aPath, bool aRead=true)
Definition TextSourceCache.cpp:31
TextSource * FindSource(const UtPath &aPath, bool aRead=true)
Definition TextSourceCache.cpp:79
wizard::ProjectWorkspace * mWorkspacePtr
Definition TextSourceCache.hpp:51
SourceMap mSources
Definition TextSourceCache.hpp:52
std::set< TextSource * > mNewSources
Definition TextSourceCache.hpp:48
const SourceMap & GetSources() const
Definition TextSourceCache.hpp:44
std::map< std::string, TextSource *, wizard::UtilFileStringCompare > SourceMap
Definition TextSourceCache.hpp:43
TextSourceCache(wizard::ProjectWorkspace *aWorkspacePtr)
Definition TextSourceCache.cpp:21
Definition TextSource.hpp:48
Definition Runner.hpp:22
Copyrights Multiple, All Rights Reserved