Fix compilation on Xcode 4
- Add new files to project - Xcode 4 doesn't support inheriting constructors
This commit is contained in:
@@ -216,6 +216,10 @@
|
||||
91ACCE971900346C00FAEF8B /* sfml-window.framework in Copy Libraries and Frameworks */ = {isa = PBXBuildFile; fileRef = 91F6F8E118F87F3700E3EA15 /* sfml-window.framework */; };
|
||||
91B0D5D11E3442FE002BE4DA /* view_dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B0D5D01E34428E002BE4DA /* view_dialogs.cpp */; };
|
||||
91B0D5D21E344300002BE4DA /* view_dialogs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B0D5D01E34428E002BE4DA /* view_dialogs.cpp */; };
|
||||
91B375332969F529008B0324 /* res_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B375322969F529008B0324 /* res_dialog.cpp */; };
|
||||
91B375362969F548008B0324 /* tagfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B375352969F548008B0324 /* tagfile.cpp */; };
|
||||
91B375372969F548008B0324 /* tagfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B375352969F548008B0324 /* tagfile.cpp */; };
|
||||
91B3753A2969F57B008B0324 /* tagfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B375392969F57B008B0324 /* tagfile.cpp */; };
|
||||
91B3EF1F0F969C9C00BF5B67 /* BoECharEd.icns in Resources */ = {isa = PBXBuildFile; fileRef = 91B3EF110F969BD300BF5B67 /* BoECharEd.icns */; };
|
||||
91B3EF470F969F1700BF5B67 /* BoEScenEd.icns in Resources */ = {isa = PBXBuildFile; fileRef = 91B3EEDB0F969BA700BF5B67 /* BoEScenEd.icns */; };
|
||||
91B3EF480F969F2300BF5B67 /* pc.main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91B3EF050F969BD300BF5B67 /* pc.main.cpp */; };
|
||||
@@ -709,6 +713,11 @@
|
||||
91B0D5CF1E3408AB002BE4DA /* zakhazi */ = {isa = PBXFileReference; lastKnownFileType = folder; path = zakhazi; sourceTree = "<group>"; };
|
||||
91B0D5D01E34428E002BE4DA /* view_dialogs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = view_dialogs.cpp; sourceTree = "<group>"; };
|
||||
91B0D5D31E3446CF002BE4DA /* view_dialogs.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = view_dialogs.hpp; sourceTree = "<group>"; };
|
||||
91B375322969F529008B0324 /* res_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = res_dialog.cpp; sourceTree = "<group>"; };
|
||||
91B375342969F533008B0324 /* res_dialog.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = res_dialog.hpp; sourceTree = "<group>"; };
|
||||
91B375352969F548008B0324 /* tagfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tagfile.cpp; sourceTree = "<group>"; };
|
||||
91B375382969F55B008B0324 /* tagfile.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = tagfile.hpp; sourceTree = "<group>"; };
|
||||
91B375392969F57B008B0324 /* tagfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tagfile.cpp; sourceTree = "<group>"; };
|
||||
91B3E8A50F938FFE00BF5B67 /* boe.consts.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = boe.consts.hpp; sourceTree = "<group>"; };
|
||||
91B3EED90F969BA700BF5B67 /* BoEScenEd-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "BoEScenEd-Info.plist"; path = "../../pkg/mac/BoEScenEd-Info.plist"; sourceTree = SOURCE_ROOT; };
|
||||
91B3EEDB0F969BA700BF5B67 /* BoEScenEd.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = BoEScenEd.icns; path = icons/mac/BoEScenEd.icns; sourceTree = "<group>"; };
|
||||
@@ -1080,11 +1089,13 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
91EC1EFF23DDFF9D00271891 /* res_cursor.cpp */,
|
||||
91B375322969F529008B0324 /* res_dialog.cpp */,
|
||||
91EC1F0023DDFF9D00271891 /* res_font.cpp */,
|
||||
91EC1F0123DDFF9D00271891 /* res_image.cpp */,
|
||||
91EC1F0223DDFF9D00271891 /* res_sound.cpp */,
|
||||
91EC1F0323DDFF9D00271891 /* res_strings.cpp */,
|
||||
9185BDA51EA055180027C346 /* res_cursor.hpp */,
|
||||
91B375342969F533008B0324 /* res_dialog.hpp */,
|
||||
9185BDA61EA055180027C346 /* res_font.hpp */,
|
||||
912DFE8A18E24B4C00B00D75 /* res_image.hpp */,
|
||||
9185BDA71EA055180027C346 /* res_sound.hpp */,
|
||||
@@ -1246,10 +1257,12 @@
|
||||
91E5C7A60F9F615400C21460 /* fileio_scen.cpp */,
|
||||
915E09081A316D89008BDF00 /* map_parse.cpp */,
|
||||
915325181A2E37EE000A9A1C /* special_parse.cpp */,
|
||||
91B375352969F548008B0324 /* tagfile.cpp */,
|
||||
91BFA3D81902AD78001686E4 /* tarball.cpp */,
|
||||
91E5C7A50F9F615400C21460 /* fileio.hpp */,
|
||||
915E09071A316D6A008BDF00 /* map_parse.hpp */,
|
||||
91F06E8F1A2EBEE70038E902 /* special_parse.hpp */,
|
||||
91B375382969F55B008B0324 /* tagfile.hpp */,
|
||||
91BFA3D91902ADD5001686E4 /* tarball.hpp */,
|
||||
91BFA3DC19033E00001686E4 /* gzstream */,
|
||||
912DFE8718E24B0B00B00D75 /* resmgr */,
|
||||
@@ -1471,6 +1484,7 @@
|
||||
91CC173A1B421CA0003D9A69 /* scen_read.cpp */,
|
||||
91CC173B1B421CA0003D9A69 /* scen_write.cpp */,
|
||||
919B13A51BBDE985009905A4 /* spec_legacy.cpp */,
|
||||
91B375392969F57B008B0324 /* tagfile.cpp */,
|
||||
9176FEC41D550EFD006EF694 /* talk_legacy.cpp */,
|
||||
91C2A6EE1B8FAA8E00346948 /* talk_read.cpp */,
|
||||
91E381471B97675900F69B81 /* talk_write.cpp */,
|
||||
@@ -1993,6 +2007,8 @@
|
||||
9149924D25913E3F00B5BE97 /* led.cpp in Sources */,
|
||||
9149924F25913E3F00B5BE97 /* ledgroup.cpp in Sources */,
|
||||
91499253259140FF00B5BE97 /* keycodes.cpp in Sources */,
|
||||
91B375332969F529008B0324 /* res_dialog.cpp in Sources */,
|
||||
91B375362969F548008B0324 /* tagfile.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@@ -2061,6 +2077,8 @@
|
||||
9176FECC1D550EFE006EF694 /* town_legacy.cpp in Sources */,
|
||||
91C548F81D8B2FE400FE6A7B /* pc_read.cpp in Sources */,
|
||||
91C548F91D8B338700FE6A7B /* pc.cpp in Sources */,
|
||||
91B375372969F548008B0324 /* tagfile.cpp in Sources */,
|
||||
91B3753A2969F57B008B0324 /* tagfile.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@@ -20,6 +20,13 @@
|
||||
class cTagFile;
|
||||
class cTagFile_Page;
|
||||
|
||||
// Helper functions for inheriting constructors in tagfile classes
|
||||
// This is needed because Xcode 4 does not support inheriting constructors.
|
||||
// Note that both these macros set the access level to public!
|
||||
#define DEFINE_TAGFILE_PAGE(Class, Base) protected: Class() = default; public: Class(cTagFile& owner) : Base(owner) {}
|
||||
#define DEFINE_TAGFILE_MULTIPAGE(Class, Base) friend class pMultiPage<Class>; DEFINE_TAGFILE_PAGE(Class, Base)
|
||||
#define DEFINE_TAGFILE_TAG(Class, Base) public: Class(cTagFile_Page& owner, const std::string& key) : Base(owner, key) {}
|
||||
|
||||
class cTagFile_Tag {
|
||||
protected:
|
||||
void readValueFrom(std::istream& file, std::string& to);
|
||||
@@ -113,13 +120,18 @@ public:
|
||||
template<typename Self>
|
||||
class pMultiPage : public cTagFile_Page {
|
||||
std::shared_ptr<Self> next;
|
||||
std::shared_ptr<Self> make_page() {
|
||||
return std::shared_ptr<Self>(new Self);
|
||||
}
|
||||
protected:
|
||||
pMultiPage() : cTagFile_Page() {}
|
||||
public:
|
||||
using cTagFile_Page::cTagFile_Page;
|
||||
pMultiPage(cTagFile& owner) : cTagFile_Page(owner) {};
|
||||
void readFrom(std::istream& file) override {
|
||||
if(!hasBeenRead) {
|
||||
cTagFile_Page::readFrom(file);
|
||||
} else {
|
||||
if(!next) next = std::make_shared<Self>();
|
||||
if(!next) next = make_page();
|
||||
next->readFrom(file);
|
||||
}
|
||||
}
|
||||
@@ -143,12 +155,12 @@ public:
|
||||
}
|
||||
Self& operator[](size_t i) {
|
||||
if(i == 0) return static_cast<Self&>(*this);
|
||||
if(!next) next = std::make_shared<Self>();
|
||||
if(!next) next = make_page();
|
||||
return next->operator[](i - 1);
|
||||
}
|
||||
Self& add() {
|
||||
if(next) return next->add();
|
||||
next = std::make_shared<Self>();
|
||||
next = make_page();
|
||||
return *next;
|
||||
}
|
||||
size_t size() {
|
||||
@@ -170,7 +182,7 @@ template<typename T>
|
||||
class tBasicTag : public cTagFile_Tag {
|
||||
T value;
|
||||
public:
|
||||
using cTagFile_Tag::cTagFile_Tag;
|
||||
DEFINE_TAGFILE_TAG(tBasicTag, cTagFile_Tag);
|
||||
void readFrom(const std::string&, std::istream& file) override {
|
||||
readValueFrom(file, value);
|
||||
}
|
||||
@@ -193,7 +205,7 @@ template<typename T>
|
||||
class tHexTag : public cTagFile_Tag {
|
||||
T value;
|
||||
public:
|
||||
using cTagFile_Tag::cTagFile_Tag;
|
||||
DEFINE_TAGFILE_TAG(tHexTag, cTagFile_Tag);
|
||||
void readFrom(const std::string&, std::istream& file) override {
|
||||
readValueFrom(file, value);
|
||||
}
|
||||
@@ -216,13 +228,13 @@ template<typename T>
|
||||
class tOptionalTag : public cTagFile_Tag {
|
||||
boost::optional<T> value;
|
||||
public:
|
||||
using cTagFile_Tag::cTagFile_Tag;
|
||||
DEFINE_TAGFILE_TAG(tOptionalTag, cTagFile_Tag);
|
||||
void readFrom(const std::string&, std::istream& file) override {
|
||||
value.emplace();
|
||||
readValueFrom(file, *value);
|
||||
}
|
||||
void writeTo(const std::string& key, std::ostream& file) override {
|
||||
if(value.has_value()) {
|
||||
if(value) {
|
||||
file << key << ' ';
|
||||
writeValueTo(file, *value);
|
||||
file << '\n';
|
||||
@@ -245,7 +257,7 @@ template<>
|
||||
class tOptionalTag<bool> : public cTagFile_Tag {
|
||||
bool value = false;
|
||||
public:
|
||||
using cTagFile_Tag::cTagFile_Tag;
|
||||
DEFINE_TAGFILE_TAG(tOptionalTag, cTagFile_Tag);
|
||||
void readFrom(const std::string&, std::istream&) override {
|
||||
value = true;
|
||||
}
|
||||
@@ -268,7 +280,7 @@ template<typename T>
|
||||
class tArrayTag : public cTagFile_Tag {
|
||||
std::vector<T> values;
|
||||
public:
|
||||
using cTagFile_Tag::cTagFile_Tag;
|
||||
DEFINE_TAGFILE_TAG(tArrayTag, cTagFile_Tag)
|
||||
void readFrom(const std::string&, std::istream& file) override {
|
||||
values.emplace_back();
|
||||
readValueFrom(file, values.back());
|
||||
|
@@ -17,13 +17,13 @@ std::ostream& operator<<(std::ostream& os, const tBasicTag<T>& tag) {
|
||||
|
||||
class pSamplePage1 : public cTagFile_Page {
|
||||
public:
|
||||
using cTagFile_Page::cTagFile_Page;
|
||||
DEFINE_TAGFILE_PAGE(pSamplePage1, cTagFile_Page);
|
||||
tBasicTag<int> a{*this, "A"}, b{*this, "B"}, c{*this, "C"};
|
||||
};
|
||||
|
||||
class pSamplePage2 : public cTagFile_Page {
|
||||
public:
|
||||
using cTagFile_Page::cTagFile_Page;
|
||||
DEFINE_TAGFILE_PAGE(pSamplePage2, cTagFile_Page);
|
||||
tBasicTag<std::string> x{*this, "X"}, y{*this, "Y"}, z{*this, "Z"};
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
|
||||
class pComplexPage : public cTagFile_Page {
|
||||
public:
|
||||
using cTagFile_Page::cTagFile_Page;
|
||||
DEFINE_TAGFILE_PAGE(pComplexPage, cTagFile_Page);
|
||||
tBasicTag<int> id{*this, "ID"};
|
||||
tArrayTag<std::string> strings{*this, "STRING"};
|
||||
tArrayTag<std::pair<int, int>> locations{*this, "LOC"};
|
||||
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
class pSampleMultiPage : public pMultiPage<pSampleMultiPage> {
|
||||
public:
|
||||
using pMultiPage::pMultiPage;
|
||||
DEFINE_TAGFILE_MULTIPAGE(pSampleMultiPage, pMultiPage);
|
||||
tBasicTag<char> id{*this, "ID"};
|
||||
tBasicTag<int> value{*this, "VALUE"};
|
||||
tBasicTag<std::string> comment{*this, "COMMENT"};
|
||||
|
Reference in New Issue
Block a user