http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/include/ignite/odbc/system/socket_client.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/system/socket_client.h b/modules/platforms/cpp/odbc/include/ignite/odbc/system/socket_client.h new file mode 100644 index 0000000..ee58927 --- /dev/null +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/system/socket_client.h @@ -0,0 +1,92 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_SYSTEM_SOCKET_CLIENT +#define _IGNITE_ODBC_SYSTEM_SOCKET_CLIENT + +#include <stdint.h> + +#include "ignite/common/common.h" + +namespace ignite +{ + namespace odbc + { + namespace tcp + { + /** + * Socket client implementation. + */ + class SocketClient + { + public: + /** + * Constructor. + */ + SocketClient(); + + /** + * Destructor. + */ + ~SocketClient(); + + /** + * Establish connection with remote TCP service. + * + * @param hostname Remote host name. + * @param port TCP service port. + * @return True on success. + */ + bool Connect(const char* hostname, uint16_t port); + + /** + * Close established connection. + * + * @return True on success. + */ + void Close(); + + /** + * Send data by established connection. + * + * @param data Pointer to data to be sent. + * @param size Size of the data in bytes. + * @return Number of bytes that have been sent on success and negative + * value on failure. + */ + int Send(const int8_t* data, size_t size); + + /** + * Receive data from established connection. + * + * @param data Pointer to data buffer. + * @param size Size of the buffer in bytes. + * @return Number of bytes that have been received on success and negative + * value on failure. + */ + int Receive(int8_t* buffer, size_t size); + + private: + intptr_t socketHandle; + + IGNITE_NO_COPY_ASSIGNMENT(SocketClient) + }; + } + } +} + +#endif //_IGNITE_ODBC_SYSTEM_SOCKET_CLIENT \ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h b/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h new file mode 100644 index 0000000..a85cfeb --- /dev/null +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/type_traits.h @@ -0,0 +1,316 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_TYPE_TRAITS +#define _IGNITE_ODBC_TYPE_TRAITS + +#include <stdint.h> + +#include <string> + +namespace ignite +{ + namespace odbc + { + namespace type_traits + { +#ifdef ODBC_DEBUG + /** + * Convert statement attribute ID to string containing its name. + * Debug function. + * @param type Attribute ID. + * @return Null-terminated string containing attribute name. + */ + const char* StatementAttrIdToString(long id); +#endif + + /** + * ODBC type aliases. + * We use these so we will not be needed to include system-specific + * headers in our header files. + */ + enum IgniteSqlType + { + /** Alias for the SQL_C_CHAR type. */ + IGNITE_ODBC_C_TYPE_CHAR, + + /** Alias for the SQL_C_WCHAR type. */ + IGNITE_ODBC_C_TYPE_WCHAR, + + /** Alias for the SQL_C_SSHORT type. */ + IGNITE_ODBC_C_TYPE_SIGNED_SHORT, + + /** Alias for the SQL_C_USHORT type. */ + IGNITE_ODBC_C_TYPE_UNSIGNED_SHORT, + + /** Alias for the SQL_C_SLONG type. */ + IGNITE_ODBC_C_TYPE_SIGNED_LONG, + + /** Alias for the SQL_C_ULONG type. */ + IGNITE_ODBC_C_TYPE_UNSIGNED_LONG, + + /** Alias for the SQL_C_FLOAT type. */ + IGNITE_ODBC_C_TYPE_FLOAT, + + /** Alias for the SQL_C_DOUBLE type. */ + IGNITE_ODBC_C_TYPE_DOUBLE, + + /** Alias for the SQL_C_BIT type. */ + IGNITE_ODBC_C_TYPE_BIT, + + /** Alias for the SQL_C_STINYINT type. */ + IGNITE_ODBC_C_TYPE_SIGNED_TINYINT, + + /** Alias for the SQL_C_UTINYINT type. */ + IGNITE_ODBC_C_TYPE_UNSIGNED_TINYINT, + + /** Alias for the SQL_C_SBIGINT type. */ + IGNITE_ODBC_C_TYPE_SIGNED_BIGINT, + + /** Alias for the SQL_C_UBIGINT type. */ + IGNITE_ODBC_C_TYPE_UNSIGNED_BIGINT, + + /** Alias for the SQL_C_BINARY type. */ + IGNITE_ODBC_C_TYPE_BINARY, + + /** Alias for the SQL_C_TDATE type. */ + IGNITE_ODBC_C_TYPE_TDATE, + + /** Alias for the SQL_C_TTIME type. */ + IGNITE_ODBC_C_TYPE_TTIME, + + /** Alias for the SQL_C_TTIMESTAMP type. */ + IGNITE_ODBC_C_TYPE_TTIMESTAMP, + + /** Alias for the SQL_C_NUMERIC type. */ + IGNITE_ODBC_C_TYPE_NUMERIC, + + /** Alias for the SQL_C_GUID type. */ + IGNITE_ODBC_C_TYPE_GUID, + + /** Alias for the SQL_DEFAULT. */ + IGNITE_ODBC_C_TYPE_DEFAULT, + + /** Alias for all unsupported types. */ + IGNITE_ODBC_C_TYPE_UNSUPPORTED + }; + + /** + * SQL type name constants. + */ + class SqlTypeName + { + public: + /** VARCHAR SQL type name constant. */ + static const std::string VARCHAR; + + /** SMALLINT SQL type name constant. */ + static const std::string SMALLINT; + + /** INTEGER SQL type name constant. */ + static const std::string INTEGER; + + /** DECIMAL SQL type name constant. */ + static const std::string DECIMAL; + + /** FLOAT SQL type name constant. */ + static const std::string FLOAT; + + /** DOUBLE SQL type name constant. */ + static const std::string DOUBLE; + + /** BIT SQL type name constant. */ + static const std::string BIT; + + /** TINYINT SQL type name constant. */ + static const std::string TINYINT; + + /** BIGINT SQL type name constant. */ + static const std::string BIGINT; + + /** BINARY SQL type name constant. */ + static const std::string BINARY; + + /** DATE SQL type name constant. */ + static const std::string DATE; + + /** TIMESTAMP SQL type name constant. */ + static const std::string TIMESTAMP; + + /** GUID SQL type name constant. */ + static const std::string GUID; + }; + + /** + * Get SQL type name for the binary type. + * + * @param binaryType Binary type. + * @return Corresponding SQL type name. + */ + const std::string& BinaryTypeToSqlTypeName(int8_t binaryType); + + /** + * Check if the C type supported by the current implementation. + * + * @param type Application type. + * @return True if the type is supported. + */ + bool IsApplicationTypeSupported(int16_t type); + + /** + * Check if the SQL type supported by the current implementation. + * + * @param type Application type. + * @return True if the type is supported. + */ + bool IsSqlTypeSupported(int16_t type); + + /** + * Get corresponding binary type for ODBC SQL type. + * + * @param sqlType SQL type. + * @return Binary type. + */ + int8_t SqlTypeToBinary(int16_t sqlType); + + /** + * Convert ODBC type to driver type alias. + * + * @param ODBC type; + * @return Internal driver type. + */ + IgniteSqlType ToDriverType(int16_t type); + + /** + * Convert binary data type to SQL data type. + * + * @param binaryType Binary data type. + * @return SQL data type. + */ + int16_t BinaryToSqlType(int8_t binaryType); + + /** + * Get binary type SQL nullability. + * + * @param binaryType Binary data type. + * @return SQL_NO_NULLS if the column could not include NULL values. + * SQL_NULLABLE if the column accepts NULL values. + * SQL_NULLABLE_UNKNOWN if it is not known whether the + * column accepts NULL values. + */ + int16_t BinaryTypeNullability(int8_t binaryType); + + /** + * Get SQL type display size. + * + * @param type SQL type. + * @return Display size. + */ + int32_t SqlTypeDisplaySize(int16_t type); + + /** + * Get binary type display size. + * + * @param type Binary type. + * @return Display size. + */ + int32_t BinaryTypeDisplaySize(int8_t type); + + /** + * Get SQL type column size. + * + * @param type SQL type. + * @return Column size. + */ + int32_t SqlTypeColumnSize(int16_t type); + + /** + * Get binary type column size. + * + * @param type Binary type. + * @return Column size. + */ + int32_t BinaryTypeColumnSize(int8_t type); + + /** + * Get SQL type transfer octet length. + * + * @param type SQL type. + * @return Transfer octet length. + */ + int32_t SqlTypeTransferLength(int16_t type); + + /** + * Get binary type transfer octet length. + * + * @param type Binary type. + * @return Transfer octet length. + */ + int32_t BinaryTypeTransferLength(int8_t type); + + /** + * Get SQL type numeric precision radix. + * + * @param type SQL type. + * @return Numeric precision radix. + */ + int32_t SqlTypeNumPrecRadix(int8_t type); + + /** + * Get binary type numeric precision radix. + * + * @param type Binary type. + * @return Numeric precision radix. + */ + int32_t BinaryTypeNumPrecRadix(int8_t type); + + /** + * Get SQL type decimal digits. + * + * @param type SQL type. + * @return Decimal digits. + */ + int32_t SqlTypeDecimalDigits(int16_t type); + + /** + * Get binary type decimal digits. + * + * @param type Binary type. + * @return Decimal digits. + */ + int32_t BinaryTypeDecimalDigits(int8_t type); + + /** + * Checks if the SQL type is unsigned. + * + * @param type SQL type. + * @return True if unsigned or non-numeric. + */ + bool SqlTypeUnsigned(int16_t type); + + /** + * Checks if the binary type is unsigned. + * + * @param type Binary type. + * @return True if unsigned or non-numeric. + */ + bool BinaryTypeUnsigned(int8_t type); + } + } +} + +#endif //_IGNITE_ODBC_TYPE_TRAITS \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h new file mode 100644 index 0000000..b2a1639 --- /dev/null +++ b/modules/platforms/cpp/odbc/include/ignite/odbc/utility.h @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _IGNITE_ODBC_UTILITY +#define _IGNITE_ODBC_UTILITY + +#ifdef min +# undef min +#endif //min + +#include <stdint.h> +#include <ctime> + +#include <string> +#include <algorithm> + +#include <ignite/common/utils.h> + +#include "ignite/impl/binary/binary_reader_impl.h" +#include "ignite/impl/binary/binary_writer_impl.h" + +#include "ignite/odbc/decimal.h" + +#ifdef ODBC_DEBUG + +extern FILE* log_file; +void logInit(const char*); + +# define LOG_MSG(fmt, ...) \ + do { \ + logInit(ODBC_LOG_PATH); \ + fprintf(log_file, "%s: " fmt, __FUNCTION__, __VA_ARGS__); \ + fflush(log_file); \ + } while (false) + +#else +# define LOG_MSG(...) +#endif + +namespace ignite +{ + namespace utility + { + /** Using common version of the util. */ + using ignite::common::IntoLower; + + /** + * Skip leading spaces. + * + * @param begin Iterator to the beginning of the character sequence. + * @param end Iterator to the end of the character sequence. + * @return Iterator to first non-blanc character. + */ + template<typename Iterator> + Iterator SkipLeadingSpaces(Iterator begin, Iterator end) + { + Iterator res = begin; + + while (isspace(*res) && res != end) + ++res; + + return res; + } + + /** + * Skip trailing spaces. + * + * @param begin Iterator to the beginning of the character sequence. + * @param end Iterator to the end of the character sequence. + * @return Iterator to last non-blanc character. + */ + template<typename Iterator> + Iterator SkipTrailingSpaces(Iterator begin, Iterator end) + { + Iterator res = end - 1; + + while (isspace(*res) && res != begin - 1) + --res; + + return res + 1; + } + + /** + * Remove leading and trailing spaces. + * + * @param begin Iterator to the beginning of the character sequence. + * @param end Iterator to the end of the character sequence. + * @return String without leading and trailing spaces. + */ + template<typename Iterator> + std::string RemoveSurroundingSpaces(Iterator begin, Iterator end) + { + std::string res; + + if (begin >= end) + return res; + + Iterator skipped_leading = SkipLeadingSpaces(begin, end); + Iterator skipped_trailing = SkipTrailingSpaces(skipped_leading, end); + + res.reserve(skipped_trailing - skipped_leading); + + std::copy(skipped_leading, skipped_trailing, std::back_insert_iterator<std::string>(res)); + + return res; + } + + template<typename T> + T* GetPointerWithOffset(T* ptr, size_t offset) + { + uint8_t* ptrBytes = (uint8_t*)ptr; + + return (T*)(ptrBytes + offset); + } + + /** + * Copy string to buffer of the specific length. + * @param str String to copy data from. + * @param buf Buffer to copy data to. + * @param buflen Length of the buffer. + * @return Length of the resulting string in buffer. + */ + size_t CopyStringToBuffer(const std::string& str, char* buf, size_t buflen); + + /** + * Read string from reader. + * @param reader Reader. + * @param str String. + */ + void ReadString(ignite::impl::binary::BinaryReaderImpl& reader, std::string& str); + + /** + * Write string using writer. + * @param writer Writer. + * @param str String. + */ + void WriteString(ignite::impl::binary::BinaryWriterImpl& writer, const std::string& str); + + /** + * Read decimal value using reader. + * + * @param reader Reader. + * @param decimal Decimal value. + */ + void ReadDecimal(ignite::impl::binary::BinaryReaderImpl& reader, Decimal& decimal); + + /** + * Write decimal value using writer. + * + * @param writer Writer. + * @param decimal Decimal value. + */ + void WriteDecimal(ignite::impl::binary::BinaryWriterImpl& writer, const Decimal& decimal); + + /** + * Convert SQL string buffer to std::string. + * + * @param sqlStr SQL string buffer. + * @param sqlStrLen SQL string length. + * @return Standard string containing the same data. + */ + std::string SqlStringToString(const unsigned char* sqlStr, int32_t sqlStrLen); + } +} + +#endif //_IGNITE_ODBC_UTILITY \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/install/ignite-odbc-install.ini ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/install/ignite-odbc-install.ini b/modules/platforms/cpp/odbc/install/ignite-odbc-install.ini new file mode 100644 index 0000000..2de265a --- /dev/null +++ b/modules/platforms/cpp/odbc/install/ignite-odbc-install.ini @@ -0,0 +1,5 @@ +[Apache Ignite] +Description=Apache Ignite +Driver=/usr/local/lib/libignite-odbc.so +DriverODBCVer=03.00 +FileUsage=0 \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/install/install_amd64.cmd ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/install/install_amd64.cmd b/modules/platforms/cpp/odbc/install/install_amd64.cmd new file mode 100644 index 0000000..15b7bd8 --- /dev/null +++ b/modules/platforms/cpp/odbc/install/install_amd64.cmd @@ -0,0 +1,29 @@ +@echo off + +set ODBC_AMD64="%1" +set ODBC_X86="%2" + +if exist %ODBC_AMD64% ( + :: Installing 64-bit driver. + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v DriverODBCVer /t REG_SZ /d "03.80" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v UsageCount /t REG_DWORD /d 00000001 /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v Driver /t REG_SZ /d "%ODBC_AMD64%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v Setup /t REG_SZ /d "%ODBC_AMD64%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Ignite" /t REG_SZ /d "Installed" /f +) else ( + echo 64-bit driver can not be found: %ODBC_AMD64% + echo Call format: install_amd64 path_to_64_bit_driver [path_to_32_bit_driver] + pause + exit /b 1 +) + +if exist %ODBC_X86% ( + rem Installing 32-bit driver. + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\Apache Ignite" /v DriverODBCVer /t REG_SZ /d "03.80" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\Apache Ignite" /v UsageCount /t REG_DWORD /d 00000001 /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\Apache Ignite" /v Driver /t REG_SZ /d "%ODBC_X86%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\Apache Ignite" /v Setup /t REG_SZ /d "%ODBC_X86%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Ignite" /t REG_SZ /d "Installed" /f +) else ( + echo 32-bit driver can not be found: %ODBC_X86% +) \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/install/install_x86.cmd ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/install/install_x86.cmd b/modules/platforms/cpp/odbc/install/install_x86.cmd new file mode 100644 index 0000000..077589d --- /dev/null +++ b/modules/platforms/cpp/odbc/install/install_x86.cmd @@ -0,0 +1,16 @@ +@echo off + +set ODBC="%1" + +if exist %ODBC% ( + :: Installing driver. + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v DriverODBCVer /t REG_SZ /d "03.80" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v UsageCount /t REG_DWORD /d 00000001 /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v Driver /t REG_SZ /d "%ODBC%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Ignite" /v Setup /t REG_SZ /d "%ODBC%" /f + reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Ignite" /t REG_SZ /d "Installed" /f +) else ( + echo Driver can not be found: %ODBC% + echo Call format: install_x86 path_to_driver + pause +) http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp new file mode 100644 index 0000000..a355625 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/linux/src/system/socket_client.cpp @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include <sys/socket.h> +#include <sys/types.h> +#include <sys/socket.h> +#include <netdb.h> +#include <unistd.h> + +#include <cstring> + +#include <sstream> + +#include "ignite/odbc/system/socket_client.h" +#include "ignite/odbc/utility.h" + +#define SOCKET_ERROR (-1) + +namespace ignite +{ + namespace odbc + { + namespace tcp + { + + SocketClient::SocketClient() : socketHandle(SOCKET_ERROR) + { + // No-op. + } + + SocketClient::~SocketClient() + { + Close(); + } + + bool SocketClient::Connect(const char* hostname, uint16_t port) + { + LOG_MSG("Host: %s, port: %d\n", hostname, port); + + addrinfo hints; + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + + std::stringstream converter; + converter << port; + + // Resolve the server address and port + addrinfo *result = NULL; + int res = getaddrinfo(hostname, converter.str().c_str(), &hints, &result); + + if (res != 0) + return false; + + // Attempt to connect to an address until one succeeds + for (addrinfo *it = result; it != NULL; it = it->ai_next) + { + LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2], it->ai_addr->sa_data[3], + it->ai_addr->sa_data[4], it->ai_addr->sa_data[5]); + + // Create a SOCKET for connecting to server + socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol); + + if (socketHandle == SOCKET_ERROR) + return false; + + // Connect to server. + res = connect(socketHandle, it->ai_addr, (int)it->ai_addrlen); + if (res == SOCKET_ERROR) + { + Close(); + + continue; + } + break; + } + + freeaddrinfo(result); + + return socketHandle != SOCKET_ERROR; + } + + void SocketClient::Close() + { + if (socketHandle != SOCKET_ERROR) + { + close(socketHandle); + + socketHandle = SOCKET_ERROR; + } + } + + int SocketClient::Send(const int8_t* data, size_t size) + { + return send(socketHandle, reinterpret_cast<const char*>(data), static_cast<int>(size), 0); + } + + int SocketClient::Receive(int8_t* buffer, size_t size) + { + return recv(socketHandle, reinterpret_cast<char*>(buffer), static_cast<int>(size), 0); + } + } + } +} + http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp new file mode 100644 index 0000000..bc4cdc0 --- /dev/null +++ b/modules/platforms/cpp/odbc/os/win/src/system/socket_client.cpp @@ -0,0 +1,133 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#define WIN32_LEAN_AND_MEAN +#define _WINSOCKAPI_ + +#include <windows.h> +#include <winsock2.h> +#include <ws2tcpip.h> + +#include <cstring> + +#include <sstream> + +#include "ignite/odbc/system/socket_client.h" +#include "ignite/odbc/utility.h" + +namespace ignite +{ + namespace odbc + { + namespace tcp + { + + SocketClient::SocketClient() : socketHandle(INVALID_SOCKET) + { + // No-op. + } + + SocketClient::~SocketClient() + { + Close(); + } + + bool SocketClient::Connect(const char* hostname, uint16_t port) + { + static bool networkInited = false; + + // Initing networking if is not inited. + if (!networkInited) + { + WSADATA wsaData; + + networkInited = (WSAStartup(MAKEWORD(2, 2), &wsaData) == 0); + + if (!networkInited) + return false; + } + + addrinfo *result = NULL; + addrinfo hints; + + LOG_MSG("Host: %s, port: %d\n", hostname, port); + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + + std::stringstream converter; + converter << port; + + // Resolve the server address and port + int res = getaddrinfo(hostname, converter.str().c_str(), &hints, &result); + + if (res != 0) + return false; + + // Attempt to connect to an address until one succeeds + for (addrinfo *it = result; it != NULL; it = it->ai_next) + { + LOG_MSG("Addr: %u.%u.%u.%u\n", it->ai_addr->sa_data[2], it->ai_addr->sa_data[3], + it->ai_addr->sa_data[4], it->ai_addr->sa_data[5]); + + // Create a SOCKET for connecting to server + socketHandle = socket(it->ai_family, it->ai_socktype, it->ai_protocol); + + if (socketHandle == INVALID_SOCKET) + return false; + + // Connect to server. + res = connect(socketHandle, it->ai_addr, static_cast<int>(it->ai_addrlen)); + if (res == SOCKET_ERROR) + { + Close(); + + continue; + } + break; + } + + freeaddrinfo(result); + + return socketHandle != INVALID_SOCKET; + } + + void SocketClient::Close() + { + if (socketHandle != INVALID_SOCKET) + { + closesocket(socketHandle); + + socketHandle = INVALID_SOCKET; + } + } + + int SocketClient::Send(const int8_t* data, size_t size) + { + return send(socketHandle, reinterpret_cast<const char*>(data), static_cast<int>(size), 0); + } + + int SocketClient::Receive(int8_t* buffer, size_t size) + { + return recv(socketHandle, reinterpret_cast<char*>(buffer), static_cast<int>(size), 0); + } + } + } +} + http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/project/README.TXT ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/README.TXT b/modules/platforms/cpp/odbc/project/README.TXT new file mode 100644 index 0000000..97f4c64 --- /dev/null +++ b/modules/platforms/cpp/odbc/project/README.TXT @@ -0,0 +1 @@ +Contains IDE projects artifacts. http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/project/vs/README.TXT ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/README.TXT b/modules/platforms/cpp/odbc/project/vs/README.TXT new file mode 100644 index 0000000..f4fb456 --- /dev/null +++ b/modules/platforms/cpp/odbc/project/vs/README.TXT @@ -0,0 +1 @@ +Contains Visual Studio project artifacts. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/project/vs/module.def ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/module.def b/modules/platforms/cpp/odbc/project/vs/module.def new file mode 100644 index 0000000..c94869b --- /dev/null +++ b/modules/platforms/cpp/odbc/project/vs/module.def @@ -0,0 +1,69 @@ + +LIBRARY ignite.odbc.dll +EXPORTS + ConfigDSN + SQLAllocConnect + SQLAllocEnv + SQLAllocStmt + SQLAllocHandle + SQLFreeConnect + SQLFreeEnv + SQLFreeStmt + SQLBindCol + SQLCancel + SQLConnect + SQLDescribeCol + SQLDisconnect + SQLError + SQLExecDirect + SQLExecute + SQLExtendedFetch + SQLFetch + SQLGetCursorName + SQLNumResultCols + SQLPrepare + SQLRowCount + SQLSetCursorName + SQLColumns + SQLDriverConnect + SQLGetData + SQLGetInfo + SQLGetTypeInfo + SQLParamData + SQLPutData + SQLStatistics + SQLTables + SQLBrowseConnect + SQLColumnPrivileges + SQLDescribeParam + SQLForeignKeys + SQLMoreResults + SQLNativeSql + SQLNumParams + SQLPrimaryKeys + SQLProcedureColumns + SQLProcedures + SQLSetPos + SQLTablePrivileges + SQLBindParameter + SQLCloseCursor + SQLColAttribute + SQLCopyDesc + SQLEndTran + SQLFetchScroll + SQLFreeHandle + SQLGetConnectAttr + SQLGetDescField + SQLGetDescRec + SQLGetDiagField + SQLGetDiagRec + SQLGetEnvAttr + SQLGetStmtAttr + SQLSetConnectAttr + SQLSetDescField + SQLSetDescRec + SQLSetEnvAttr + SQLSetStmtAttr + SQLBulkOperations + SQLSpecialColumns + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj new file mode 100644 index 0000000..1171c54 --- /dev/null +++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj @@ -0,0 +1,239 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{12F77E12-38FE-42D3-B1DA-7E5979362961}</ProjectGuid> + <RootNamespace>ignite.odbc</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v100</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v100</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v100</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v100</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + <TargetName>ignite.odbc</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + <TargetName>ignite.odbc</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + <TargetName>ignite.odbc</TargetName> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> + <IntDir>$(Platform)\$(Configuration)\</IntDir> + <TargetName>ignite.odbc</TargetName> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>false</SDLCheck> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ModuleDefinitionFile>module.def</ModuleDefinitionFile> + <AdditionalDependencies>Ws2_32.lib;Mswsock.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <SDLCheck>false</SDLCheck> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ModuleDefinitionFile>module.def</ModuleDefinitionFile> + <AdditionalDependencies>Ws2_32.lib;Mswsock.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>false</SDLCheck> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <ModuleDefinitionFile>module.def</ModuleDefinitionFile> + <AdditionalDependencies>Ws2_32.lib;Mswsock.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>false</SDLCheck> + <AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\common\include;$(ProjectDir)\..\..\..\common\os\win\include;$(ProjectDir)\..\..\..\binary\include;$(ProjectDir)\..\..\..\binary\os\win\include;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\os\win;$(ProjectDir)\..\..\src</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;IGNITE_IMPL;IGNITE_FRIEND;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <ModuleDefinitionFile>module.def</ModuleDefinitionFile> + <AdditionalDependencies>Ws2_32.lib;Mswsock.lib;Advapi32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="..\..\os\win\src\system\socket_client.cpp" /> + <ClCompile Include="..\..\src\app\application_data_buffer.cpp" /> + <ClCompile Include="..\..\src\app\parameter.cpp" /> + <ClCompile Include="..\..\src\column.cpp" /> + <ClCompile Include="..\..\src\common_types.cpp" /> + <ClCompile Include="..\..\src\config\configuration.cpp" /> + <ClCompile Include="..\..\src\config\connection_info.cpp" /> + <ClCompile Include="..\..\src\connection.cpp" /> + <ClCompile Include="..\..\src\cursor.cpp" /> + <ClCompile Include="..\..\src\decimal.cpp" /> + <ClCompile Include="..\..\src\diagnostic\diagnosable_adapter.cpp" /> + <ClCompile Include="..\..\src\diagnostic\diagnostic_record.cpp" /> + <ClCompile Include="..\..\src\diagnostic\diagnostic_record_storage.cpp" /> + <ClCompile Include="..\..\src\entry_points.cpp" /> + <ClCompile Include="..\..\src\environment.cpp" /> + <ClCompile Include="..\..\src\meta\column_meta.cpp" /> + <ClCompile Include="..\..\src\meta\table_meta.cpp" /> + <ClCompile Include="..\..\src\odbc.cpp" /> + <ClCompile Include="..\..\src\query\data_query.cpp" /> + <ClCompile Include="..\..\src\query\column_metadata_query.cpp" /> + <ClCompile Include="..\..\src\query\foreign_keys_query.cpp" /> + <ClCompile Include="..\..\src\query\primary_keys_query.cpp" /> + <ClCompile Include="..\..\src\query\special_columns_query.cpp" /> + <ClCompile Include="..\..\src\query\table_metadata_query.cpp" /> + <ClCompile Include="..\..\src\query\type_info_query.cpp" /> + <ClCompile Include="..\..\src\result_page.cpp" /> + <ClCompile Include="..\..\src\row.cpp" /> + <ClCompile Include="..\..\src\statement.cpp" /> + <ClCompile Include="..\..\src\type_traits.cpp" /> + <ClCompile Include="..\..\src\utility.cpp" /> + </ItemGroup> + <ItemGroup> + <None Include="module.def" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\include\ignite\odbc.h" /> + <ClInclude Include="..\..\include\ignite\odbc\app\application_data_buffer.h" /> + <ClInclude Include="..\..\include\ignite\odbc\app\parameter.h" /> + <ClInclude Include="..\..\include\ignite\odbc\column.h" /> + <ClInclude Include="..\..\include\ignite\odbc\common_types.h" /> + <ClInclude Include="..\..\include\ignite\odbc\config\configuration.h" /> + <ClInclude Include="..\..\include\ignite\odbc\config\connection_info.h" /> + <ClInclude Include="..\..\include\ignite\odbc\connection.h" /> + <ClInclude Include="..\..\include\ignite\odbc\cursor.h" /> + <ClInclude Include="..\..\include\ignite\odbc\decimal.h" /> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable.h" /> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable_adapter.h" /> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record.h" /> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record_storage.h" /> + <ClInclude Include="..\..\include\ignite\odbc\environment.h" /> + <ClInclude Include="..\..\include\ignite\odbc\message.h" /> + <ClInclude Include="..\..\include\ignite\odbc\meta\column_meta.h" /> + <ClInclude Include="..\..\include\ignite\odbc\meta\primary_key_meta.h" /> + <ClInclude Include="..\..\include\ignite\odbc\meta\table_meta.h" /> + <ClInclude Include="..\..\include\ignite\odbc\parser.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\data_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\column_metadata_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\foreign_keys_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\primary_keys_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\special_columns_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\table_metadata_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h" /> + <ClInclude Include="..\..\include\ignite\odbc\result_page.h" /> + <ClInclude Include="..\..\include\ignite\odbc\row.h" /> + <ClInclude Include="..\..\include\ignite\odbc\statement.h" /> + <ClInclude Include="..\..\include\ignite\odbc\system\odbc_constants.h" /> + <ClInclude Include="..\..\include\ignite\odbc\system\socket_client.h" /> + <ClInclude Include="..\..\include\ignite\odbc\type_traits.h" /> + <ClInclude Include="..\..\include\ignite\odbc\utility.h" /> + <ClInclude Include="result_page.h" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\binary\project\vs\binary.vcxproj"> + <Project>{4f15669b-92eb-49f0-b774-8f19bae0b960}</Project> + </ProjectReference> + <ProjectReference Include="..\..\..\common\project\vs\common.vcxproj"> + <Project>{b63f2e01-5157-4719-8491-0e1c7cd3b701}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/764c97b9/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters ---------------------------------------------------------------------- diff --git a/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters new file mode 100644 index 0000000..901c93b --- /dev/null +++ b/modules/platforms/cpp/odbc/project/vs/odbc.vcxproj.filters @@ -0,0 +1,235 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Code"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Misc"> + <UniqueIdentifier>{3f714d15-6347-46a7-bc59-d87c1aea900c}</UniqueIdentifier> + </Filter> + <Filter Include="Code\query"> + <UniqueIdentifier>{b09a6b2e-c30c-4727-8e85-4b315e757706}</UniqueIdentifier> + </Filter> + <Filter Include="Code\meta"> + <UniqueIdentifier>{71d6243f-e8c9-4f21-a5a3-3dc89641af28}</UniqueIdentifier> + </Filter> + <Filter Include="Code\config"> + <UniqueIdentifier>{71117941-fa47-4768-afe8-901c94d431c7}</UniqueIdentifier> + </Filter> + <Filter Include="Code\app"> + <UniqueIdentifier>{dbe40149-df23-4b89-92e4-16817775cd0e}</UniqueIdentifier> + </Filter> + <Filter Include="Code\system"> + <UniqueIdentifier>{7ab279dc-6586-4b32-aca7-0add0c0ab68a}</UniqueIdentifier> + </Filter> + <Filter Include="Code\diagnostic"> + <UniqueIdentifier>{df33e506-b5d8-423f-bcc5-1825242a3e28}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\..\src\odbc.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\connection.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\environment.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\statement.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\type_traits.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\common_types.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\utility.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\cursor.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\result_page.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\row.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\data_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\column_metadata_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\table_metadata_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\meta\column_meta.cpp"> + <Filter>Code\meta</Filter> + </ClCompile> + <ClCompile Include="..\..\src\meta\table_meta.cpp"> + <Filter>Code\meta</Filter> + </ClCompile> + <ClCompile Include="..\..\src\config\configuration.cpp"> + <Filter>Code\config</Filter> + </ClCompile> + <ClCompile Include="..\..\src\config\connection_info.cpp"> + <Filter>Code\config</Filter> + </ClCompile> + <ClCompile Include="..\..\src\app\application_data_buffer.cpp"> + <Filter>Code\app</Filter> + </ClCompile> + <ClCompile Include="..\..\src\app\parameter.cpp"> + <Filter>Code\app</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\foreign_keys_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\primary_keys_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\diagnostic\diagnostic_record.cpp"> + <Filter>Code\diagnostic</Filter> + </ClCompile> + <ClCompile Include="..\..\src\diagnostic\diagnostic_record_storage.cpp"> + <Filter>Code\diagnostic</Filter> + </ClCompile> + <ClCompile Include="..\..\src\diagnostic\diagnosable_adapter.cpp"> + <Filter>Code\diagnostic</Filter> + </ClCompile> + <ClCompile Include="..\..\os\win\src\system\socket_client.cpp"> + <Filter>Code\system</Filter> + </ClCompile> + <ClCompile Include="..\..\src\decimal.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\type_info_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\column.cpp"> + <Filter>Code</Filter> + </ClCompile> + <ClCompile Include="..\..\src\query\special_columns_query.cpp"> + <Filter>Code\query</Filter> + </ClCompile> + <ClCompile Include="..\..\src\entry_points.cpp"> + <Filter>Code</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <None Include="module.def"> + <Filter>Misc</Filter> + </None> + </ItemGroup> + <ItemGroup> + <ClInclude Include="result_page.h" /> + <ClInclude Include="..\..\include\ignite\odbc\common_types.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\connection.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\cursor.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\environment.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\message.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\parser.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\result_page.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\row.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\statement.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\type_traits.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\utility.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\data_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\column_metadata_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\table_metadata_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\meta\column_meta.h"> + <Filter>Code\meta</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\meta\table_meta.h"> + <Filter>Code\meta</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\config\configuration.h"> + <Filter>Code\config</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\config\connection_info.h"> + <Filter>Code\config</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\app\application_data_buffer.h"> + <Filter>Code\app</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\app\parameter.h"> + <Filter>Code\app</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\foreign_keys_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\primary_keys_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\meta\primary_key_meta.h"> + <Filter>Code\meta</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record.h"> + <Filter>Code\diagnostic</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnostic_record_storage.h"> + <Filter>Code\diagnostic</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable.h"> + <Filter>Code\diagnostic</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\diagnostic\diagnosable_adapter.h"> + <Filter>Code\diagnostic</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\system\odbc_constants.h"> + <Filter>Code\system</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\system\socket_client.h"> + <Filter>Code\system</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\decimal.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\type_info_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\column.h"> + <Filter>Code</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc\query\special_columns_query.h"> + <Filter>Code\query</Filter> + </ClInclude> + <ClInclude Include="..\..\include\ignite\odbc.h"> + <Filter>Code</Filter> + </ClInclude> + </ItemGroup> +</Project> \ No newline at end of file
