From 62d5ab15a5b43bb57d7b93898ab21e496893c8a7 Mon Sep 17 00:00:00 2001 From: archshift Date: Tue, 2 Sep 2014 23:21:34 -0700 Subject: Quick fix for a preprocessor error with clang on OS X --- lib/tolua++/include/tolua++.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/tolua++/include/tolua++.h b/lib/tolua++/include/tolua++.h index 8da427fe3..c8b654ae6 100644 --- a/lib/tolua++/include/tolua++.h +++ b/lib/tolua++/include/tolua++.h @@ -36,7 +36,9 @@ extern "C" { #define TEMPLATE_BIND(p) #endif -#define TOLUA_TEMPLATE_BIND(p) +#ifndef TOLUA_TEMPLATE_BIND + #define TOLUA_TEMPLATE_BIND(p) +#endif #define TOLUA_PROTECTED_DESTRUCTOR #define TOLUA_PROPERTY_TYPE(p) -- cgit v1.2.3 From b4c6ad0036bf6cf83e2d5e56defcefdcf6f2d4a4 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 3 Sep 2014 22:37:31 +0200 Subject: Updated SQLiteCpp. This should fix #1374. --- lib/SQLiteCpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/SQLiteCpp b/lib/SQLiteCpp index 27b9d1118..203c2fb68 160000 --- a/lib/SQLiteCpp +++ b/lib/SQLiteCpp @@ -1 +1 @@ -Subproject commit 27b9d111818af3b05bcf4153bb6e380fe1dd6816 +Subproject commit 203c2fb68bbf871eaf4ca98756a113d74d620dea -- cgit v1.2.3 From fac89d0c437c822e41fe12529a875279f48fd2d0 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 3 Sep 2014 23:00:16 +0200 Subject: Added cIniFile::HasValue() function. --- lib/inifile/iniFile.cpp | 18 ++++++++++++++++++ lib/inifile/iniFile.h | 5 +++++ 2 files changed, 23 insertions(+) (limited to 'lib') diff --git a/lib/inifile/iniFile.cpp b/lib/inifile/iniFile.cpp index 2bf6c91ed..7cfe7661f 100644 --- a/lib/inifile/iniFile.cpp +++ b/lib/inifile/iniFile.cpp @@ -668,6 +668,24 @@ void cIniFile::Clear(void) +bool cIniFile::HasValue(const AString & a_KeyName, const AString & a_ValueName) +{ + // Find the key: + int keyID = FindKey(a_KeyName); + if (keyID == noID) + { + return false; + } + + // Find the value: + int valueID = FindValue(keyID, a_ValueName); + return (valueID != noID); +} + + + + + void cIniFile::AddHeaderComment(const AString & comment) { comments.push_back(comment); diff --git a/lib/inifile/iniFile.h b/lib/inifile/iniFile.h index 58fecd0cf..33229bff0 100644 --- a/lib/inifile/iniFile.h +++ b/lib/inifile/iniFile.h @@ -53,7 +53,9 @@ private: /// Removes the UTF-8 BOMs (Byte order makers), if present. void RemoveBom(AString & a_line) const; + public: + enum errors { noID = -1, @@ -79,6 +81,9 @@ public: /// Deletes all stored ini data (but doesn't touch the file) void Clear(void); + + /** Returns true iff the specified value exists. */ + bool HasValue(const AString & a_KeyName, const AString & a_ValueName); /// Returns index of specified key, or noID if not found int FindKey(const AString & keyname) const; -- cgit v1.2.3