Game Develop Core: SourceFile.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
SourceFile.h
Go to the documentation of this file.
1
5 #ifndef SOURCEFILE_H
6 #define SOURCEFILE_H
7 #include <ctime>
8 #include <string>
9 #include <boost/shared_ptr.hpp>
10 #include <boost/weak_ptr.hpp>
11 class TiXmlElement;
12 class BaseEvent;
13
14 namespace gd
15 {
16
23 class GD_CORE_API SourceFile
24 {
25 public:
26 SourceFile();
27 virtual ~SourceFile();
28
32 std::string GetFileName() const { return filename; };
33
37 void SetFileName(std::string filename_) { filename = filename_; };
38
42 void LoadFromXml(const TiXmlElement * elem);
43
47 void SaveToXml(TiXmlElement * elem);
48
52 void SetGDManaged(bool gdManaged_) { gdManaged = gdManaged_; };
53
57 bool IsGDManaged() const { return gdManaged; };
58
65 void SetAssociatedEvent(boost::weak_ptr<BaseEvent> event) { associatedGdEvent = event; };
66
72 boost::weak_ptr<BaseEvent> GetAssociatedEvent() const { return associatedGdEvent; };
73
74 private:
75
76 std::string filename;
77 time_t lastBuildTimeStamp;
78 bool gdManaged;
79 boost::weak_ptr<BaseEvent> associatedGdEvent;
80 };
81
82 //"Tool" Functions
83
87 struct ExternalSourceFileHasName : public std::binary_function<boost::shared_ptr<SourceFile>, std::string, bool> {
88 bool operator()(const boost::shared_ptr<SourceFile> & externalEvents, std::string name) const { return externalEvents->GetFileName() == name; }
89 };
90
91 }
92
93 #endif // SOURCEFILE_H