Skip to content

Commit d444360

Browse files
committed
- Re-organising for iOS compilation
1 parent 761fd46 commit d444360

32 files changed

+104
-101
lines changed

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(cldeplus)
44
# Build variables
55
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
66
set(VERSION 0.7.0)
7-
set(STORAGE /Volumes/External-SSD)
7+
set(STORAGE "~/Devel")
88
set(EXTRA_DIR ${STORAGE}/Extra)
99
set(MYSQL_DIR ${EXTRA_DIR}/mysql-connector-c-6.1.6-osx10.8-x86_64)
1010
set(CLDEPARSER_DIR "${EXTRA_DIR}/cldeparser-1.0.0")
@@ -34,7 +34,7 @@ file(GLOB_RECURSE DRIVERS_SQLITE Source/Drivers/SQLite/*.cpp Source/Drivers/SQLi
3434
# COMPLETE_SOURCE
3535
set(COMPLETE_SOURCE
3636
Source/cldeplus.h
37-
Source/definitions.h
37+
Source/portable.h
3838
${FOUNDATION_SOURCE}
3939
${RELATION_SOURCE}
4040
${SEGMENTATION_SOURCE}
@@ -52,10 +52,10 @@ set_target_properties(cldeplus cldeplus-static PROPERTIES
5252
SOVERSION ${VERSION}
5353
)
5454

55-
#if (APPLE)
56-
# set_property(TARGET cldeplus PROPERTY PREFIX "lib")
57-
# set_property(TARGET cldeplus PROPERTY SUFFIX ".so")
58-
#endif ()
55+
if (APPLE)
56+
set_property(TARGET cldeplus PROPERTY PREFIX "lib")
57+
set_property(TARGET cldeplus PROPERTY SUFFIX ".so")
58+
endif ()
5959

6060
# INSTALLATION
6161
set(INSTALL_DIR "${EXTRA_DIR}")

Source/Drivers/MySql/MySqlSourceDriver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
#include <mysql.h>
2222
#include "../../Foundation/Enum/CommonBufferSize.h"
2323
#include "../../Foundation/Data/ValueFactory.h"
24-
#include "../../Foundation/Data/Helper/TypeHelper.h"
24+
#include "../../Foundation/Data/Helper/ValueEnumsHelper.h"
2525
#include "../../Foundation/Data/Helper/ValueHelper.h"
2626
#include "../../Foundation/Query/Helper/SqlHelper.h"
2727
#include "../../Foundation/Store/Helper/EntityStoreHelper.h"
@@ -292,7 +292,7 @@ namespace CLDEPlus {
292292
break;
293293
}
294294
default: {
295-
using TypeHelper = Foundation::Data::Helper::TypeHelper;
295+
using TypeHelper = Foundation::Data::Helper::ValueEnumsHelper;
296296
string typeName{TypeHelper::CopyValueTypeToString(dataType)};
297297
string msg{"MySql driver does not support " + typeName + " yet"};
298298
throw MySqlSourceException{msg};
@@ -380,7 +380,7 @@ namespace CLDEPlus {
380380
break;
381381
}
382382
default: {
383-
using TypeHelper = Foundation::Data::Helper::TypeHelper;
383+
using TypeHelper = Foundation::Data::Helper::ValueEnumsHelper;
384384
string typeName{TypeHelper::CopyValueTypeToString(dataType)};
385385
string msg{"MySqlSourceDriver(SetupBind) does not support " + typeName + " yet"};
386386
throw MySqlSourceException{msg};

Source/Drivers/SQLite/SQLiteSourceDriver.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ limitations under the License.
1616
1717
*/
1818

19-
#include <cstdlib>
2019
#include "../../Foundation/Data/ValueFactory.h"
2120
#include "../../Foundation/Query/CriteriaComposite.h"
2221
#include "../../Foundation/Query/Comparative.h"
2322
#include "../../Foundation/Query/Helper/SqlHelper.h"
2423
#include "../../Foundation/Query/Helper/CriteriaHelper.h"
2524
#include "../../Foundation/Store/Helper/EntityStoreHelper.h"
26-
#include "../../Foundation/Exception/CLDENonSupportedDataTypeException.h"
2725
#include "Amalgamation/sqlite3.h"
2826
#include "SQLiteSourceDriver.h"
2927

@@ -68,17 +66,17 @@ namespace CLDEPlus {
6866
using ValueType = Foundation::Data::ValueType;
6967
using UPtrCommand = unique_ptr<Command>;
7068

71-
class SQLiteSourceDriver::SQLiteApiImpl {
69+
class SQLiteSourceDriver::SQLiteImpl {
7270

7371
string &connectionString;
7472
sqlite3 *_ptrSqlite3 = nullptr;
7573

7674
public:
77-
SQLiteApiImpl(string &connectionString) : connectionString(connectionString) {
75+
SQLiteImpl(string &connectionString) : connectionString(connectionString) {
7876
//
7977
};
8078

81-
~SQLiteApiImpl() {
79+
~SQLiteImpl() {
8280
if (_ptrSqlite3 != nullptr) {
8381
sqlite3_close(_ptrSqlite3);
8482
}
@@ -349,7 +347,7 @@ namespace CLDEPlus {
349347
};
350348

351349
SQLiteSourceDriver::SQLiteSourceDriver(const Foundation::SPtrEntityMap &entityMap)
352-
: EntitySourceDriver(entityMap), _sqliteApiImpl(new SQLiteApiImpl(_optionArgs.ConnectionString)) {
350+
: EntitySourceDriver(entityMap), _sqliteApiImpl(new SQLiteImpl(_optionArgs.ConnectionString)) {
353351
Init();
354352
}
355353

@@ -388,7 +386,7 @@ namespace CLDEPlus {
388386
void SQLiteSourceDriver::Connect() {
389387

390388
if (!_sqliteApiImpl) {
391-
_sqliteApiImpl = cldeplus_make_shared<SQLiteApiImpl>(_optionArgs.ConnectionString);
389+
_sqliteApiImpl = cldeplus_make_unique<SQLiteImpl>(_optionArgs.ConnectionString);
392390
}
393391

394392
_sqliteApiImpl->Connect();

Source/Drivers/SQLite/SQLiteSourceDriver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ namespace CLDEPlus {
6868

6969

7070
private:
71-
class SQLiteApiImpl;
72-
using SPtrSQLiteApiImpl = shared_ptr<SQLiteApiImpl>;
73-
SPtrSQLiteApiImpl _sqliteApiImpl;
71+
class SQLiteImpl;
72+
using UPtrSQLiteImpl = unique_ptr<SQLiteImpl>;
73+
UPtrSQLiteImpl _sqliteApiImpl;
7474

7575
Options _optionArgs;
7676

Source/Foundation/Cell.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
*/
1818

1919
#include "Cell.h"
20-
#include "Data/Helper/TypeHelper.h"
20+
#include "Data/Helper/ValueEnumsHelper.h"
2121
#include "Exception/CLDEEntityException.h"
2222

2323
namespace CLDEPlus {
@@ -32,17 +32,17 @@ namespace CLDEPlus {
3232
}
3333

3434
string Cell::ToString() const {
35-
string result{_value->ToString() + "(" + Data::Helper::TypeHelper::CopyValueTypeToString(_value->getDataType()) + ")"};
35+
string result{_value->ToString() + "(" + Data::Helper::ValueEnumsHelper::CopyValueTypeToString(_value->getDataType()) + ")"};
3636
return result;
3737
}
3838

3939
void Cell::setValue(Data::SPtrValue const &value) {
4040

4141
if (value->getDataType() != _column->getDataType()) {
4242
string msg{"Value has type "
43-
+ Data::Helper::TypeHelper::CopyValueTypeToString(value->getDataType())
43+
+ Data::Helper::ValueEnumsHelper::CopyValueTypeToString(value->getDataType())
4444
+ " that is different with column " + _column->ToString()
45-
+ "(" + Data::Helper::TypeHelper::CopyValueTypeToString(_column->getDataType()) + ")"};
45+
+ "(" + Data::Helper::ValueEnumsHelper::CopyValueTypeToString(_column->getDataType()) + ")"};
4646
throw Exception::CLDEEntityException{msg};
4747
}
4848

Source/Foundation/Column.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ limitations under the License.
1616
1717
*/
1818

19-
#include "Data/Helper/TypeHelper.h"
2019
#include "Column.h"
20+
#include "Data/Helper/ValueEnumsHelper.h"
2121

2222
namespace CLDEPlus {
2323
namespace Foundation {
@@ -34,7 +34,7 @@ namespace CLDEPlus {
3434
}
3535

3636
string Column::ToString() const {
37-
string result{_name + "(" + Data::Helper::TypeHelper::CopyValueTypeToString(_dataType) +
37+
string result{_name + "(" + Data::Helper::ValueEnumsHelper::CopyValueTypeToString(_dataType) +
3838
"[" + std::to_string(_length) + "]" + ")"};
3939
return result;
4040
}

Source/Foundation/Column.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121

2222
#include "../Portable/CommonTypes.h"
2323
#include "Common/IPrintable.h"
24-
#include "Data/TypeEnums.h"
24+
#include "Data/ValueEnums.h"
2525

2626
namespace CLDEPlus {
2727
namespace Foundation {

Source/Foundation/Data/Comparer/Greater.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
*/
1818

1919
#include "Greater.h"
20-
#include "../Helper/TypeHelper.h"
20+
#include "../Helper/ValueEnumsHelper.h"
2121
#include "../Type/String.h"
2222
#include "../Type/VarChar.h"
2323
#include "../../Exception/CLDENotImplementedException.h"
@@ -32,8 +32,8 @@ namespace CLDEPlus {
3232
const Data::SPtrValue &rhs) const {
3333

3434
if (lhs->getDataType() != rhs->getDataType() || lhs->getCategory() != rhs->getCategory()) {
35-
string lhsType = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
36-
string rhsType = Data::Helper::TypeHelper::CopyValueTypeToString(rhs->getDataType());
35+
string lhsType = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
36+
string rhsType = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(rhs->getDataType());
3737
string msg{lhsType + " has different type/category with " + rhsType};
3838
throw Exception::CLDENonSupportedDataTypeException{msg};
3939
}
@@ -115,12 +115,12 @@ namespace CLDEPlus {
115115
return *ptrLhsTmp > *ptrRhsTmp;
116116
}
117117
case ValueType::Currency: {
118-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
118+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
119119
string msg{type + " is not supported by the numeric comparer"};
120120
throw Exception::CLDENonSupportedDataTypeException{msg};
121121
}
122122
default: {
123-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
123+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
124124
string msg{type + " is not supported by the numeric comparer"};
125125
throw Exception::CLDENonSupportedDataTypeException{msg};
126126
}
@@ -150,12 +150,12 @@ namespace CLDEPlus {
150150
(const char *) ptrRhsTmp->PointerToBuffer()) > 0;
151151
}
152152
case ValueType::Text: {
153-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
153+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
154154
string msg{type + " is not supported by the character based comparer"};
155155
throw Exception::CLDENonSupportedDataTypeException{msg};
156156
}
157157
default: {
158-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
158+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
159159
string msg{type + " is not supported by the character based comparer"};
160160
throw Exception::CLDENonSupportedDataTypeException{msg};
161161
}
@@ -179,7 +179,7 @@ namespace CLDEPlus {
179179
return lhsComparable.GreaterThan(rhsComparable);
180180
}
181181
default: {
182-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
182+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
183183
string msg{type + " is not supported by the date&time based comparer"};
184184
throw Exception::CLDENonSupportedDataTypeException{msg};
185185
}

Source/Foundation/Data/Comparer/Less.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
*/
1818

1919
#include "Less.h"
20-
#include "../Helper/TypeHelper.h"
20+
#include "../Helper/ValueEnumsHelper.h"
2121
#include "../Type/String.h"
2222
#include "../Type/VarChar.h"
2323
#include "../../Exception/CLDENotImplementedException.h"
@@ -30,8 +30,8 @@ namespace CLDEPlus {
3030
bool Data::Comparer::Less::operator()(const Data::SPtrValue &lhs, const Data::SPtrValue &rhs) const {
3131

3232
if (lhs->getDataType() != rhs->getDataType() || lhs->getCategory() != rhs->getCategory()) {
33-
string lhsType = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
34-
string rhsType = Data::Helper::TypeHelper::CopyValueTypeToString(rhs->getDataType());
33+
string lhsType = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
34+
string rhsType = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(rhs->getDataType());
3535
string msg{lhsType + " has different type/category with " + rhsType};
3636
throw Exception::CLDENonSupportedDataTypeException{msg};
3737
}
@@ -113,12 +113,12 @@ namespace CLDEPlus {
113113
return *ptrLhsTmp < *ptrRhsTmp;
114114
}
115115
case ValueType::Currency: {
116-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
116+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
117117
string msg{type + " is not supported by the numeric comparer"};
118118
throw Exception::CLDENonSupportedDataTypeException{msg};
119119
}
120120
default: {
121-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
121+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
122122
string msg{type + " is not supported by the numeric comparer"};
123123
throw Exception::CLDENonSupportedDataTypeException{msg};
124124
}
@@ -139,12 +139,12 @@ namespace CLDEPlus {
139139
return strcmp(ptrLhsTmp->ToString().c_str(), ptrRhsTmp->ToString().c_str()) < 0;
140140
}
141141
case ValueType::Text: {
142-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
142+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
143143
string msg{type + " is not supported by the character based comparer"};
144144
throw Exception::CLDENonSupportedDataTypeException{msg};
145145
}
146146
default: {
147-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
147+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
148148
string msg{type + " is not supported by the character based comparer"};
149149
throw Exception::CLDENonSupportedDataTypeException{msg};
150150
}
@@ -168,7 +168,7 @@ namespace CLDEPlus {
168168
return lhsComparable.LessThan(rhsComparable);
169169
}
170170
default: {
171-
string type = Data::Helper::TypeHelper::CopyValueTypeToString(lhs->getDataType());
171+
string type = Data::Helper::ValueEnumsHelper::CopyValueTypeToString(lhs->getDataType());
172172
string msg{type + " is not supported by the date&time based comparer"};
173173
throw Exception::CLDENonSupportedDataTypeException{msg};
174174
}

Source/Foundation/Data/Helper/PrimitiveHelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ namespace CLDEPlus {
2828
namespace Helper {
2929

3030
struct PrimitiveHelper {
31+
3132
template<typename T>
3233
static T ToPrimitive(SPtrValue const &value) {
3334

0 commit comments

Comments
 (0)