diff options
author | Jose <jose@zeroc.com> | 2011-12-30 23:12:14 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2011-12-30 23:12:14 +0100 |
commit | e5655fc5f648b02a567c2d6b630a8ca4430142a8 (patch) | |
tree | 6f321487b3d15d00b263c3a2e4708240b6e1dd88 | |
parent | minor test script fixes (diff) | |
download | ice-e5655fc5f648b02a567c2d6b630a8ca4430142a8.tar.bz2 ice-e5655fc5f648b02a567c2d6b630a8ca4430142a8.tar.xz ice-e5655fc5f648b02a567c2d6b630a8ca4430142a8.zip |
ICE-4574 - SQL DB and string conversions
-rw-r--r-- | cpp/src/IceGrid/SqlDB/SqlIdentityObjectInfoDict.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceGrid/SqlDB/SqlStringAdapterInfoDict.cpp | 18 | ||||
-rw-r--r-- | cpp/src/IceGrid/SqlDB/SqlStringApplicationInfoDict.cpp | 14 | ||||
-rw-r--r-- | cpp/src/IceStorm/SqlDB/SqlSubscriberMap.cpp | 22 |
4 files changed, 34 insertions, 34 deletions
diff --git a/cpp/src/IceGrid/SqlDB/SqlIdentityObjectInfoDict.cpp b/cpp/src/IceGrid/SqlDB/SqlIdentityObjectInfoDict.cpp index 60aa25bb4db..0b7b7af0f0b 100644 --- a/cpp/src/IceGrid/SqlDB/SqlIdentityObjectInfoDict.cpp +++ b/cpp/src/IceGrid/SqlDB/SqlIdentityObjectInfoDict.cpp @@ -127,8 +127,8 @@ SqlIdentityObjectInfoDict::find(const DatabaseConnectionPtr& connection, if(query.next()) { IceGrid::ObjectInfo info; - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.type = query.value(2).toString().toStdString(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.type = query.value(2).toString().toUtf8().data(); return info; } else @@ -158,8 +158,8 @@ SqlIdentityObjectInfoDict::findByType(const DatabaseConnectionPtr& connection, while(query.next()) { IceGrid::ObjectInfo info; - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.type = query.value(2).toString().toStdString(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.type = query.value(2).toString().toUtf8().data(); infos.push_back(info); } return infos; @@ -181,11 +181,11 @@ SqlIdentityObjectInfoDict::getMap(const DatabaseConnectionPtr& connection, while(query.next()) { - Ice::Identity id = _communicator->stringToIdentity(query.value(0).toString().toStdString()); + Ice::Identity id = _communicator->stringToIdentity(query.value(0).toString().toUtf8().data()); IceGrid::ObjectInfo info; - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.type = query.value(2).toString().toStdString(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.type = query.value(2).toString().toUtf8().data(); objectMap[id] = info; } diff --git a/cpp/src/IceGrid/SqlDB/SqlStringAdapterInfoDict.cpp b/cpp/src/IceGrid/SqlDB/SqlStringAdapterInfoDict.cpp index ba6dad6c251..8ffb484139c 100644 --- a/cpp/src/IceGrid/SqlDB/SqlStringAdapterInfoDict.cpp +++ b/cpp/src/IceGrid/SqlDB/SqlStringAdapterInfoDict.cpp @@ -132,9 +132,9 @@ SqlStringAdapterInfoDict::find(const DatabaseConnectionPtr& connection, if(query.next()) { IceGrid::AdapterInfo info; - info.id = query.value(0).toString().toStdString(); - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.replicaGroupId = query.value(2).toString().toStdString(); + info.id = query.value(0).toString().toUtf8().data(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.replicaGroupId = query.value(2).toString().toUtf8().data(); return info; } else @@ -164,9 +164,9 @@ SqlStringAdapterInfoDict::findByReplicaGroupId(const DatabaseConnectionPtr& conn while(query.next()) { IceGrid::AdapterInfo info; - info.id = query.value(0).toString().toStdString(); - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.replicaGroupId = query.value(2).toString().toStdString(); + info.id = query.value(0).toString().toUtf8().data(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.replicaGroupId = query.value(2).toString().toUtf8().data(); infos.push_back(info); } return infos; @@ -189,9 +189,9 @@ SqlStringAdapterInfoDict::getMap(const DatabaseConnectionPtr& connection, while(query.next()) { IceGrid::AdapterInfo info; - info.id = query.value(0).toString().toStdString(); - info.proxy = _communicator->stringToProxy(query.value(1).toString().toStdString()); - info.replicaGroupId = query.value(2).toString().toStdString(); + info.id = query.value(0).toString().toUtf8().data(); + info.proxy = _communicator->stringToProxy(query.value(1).toString().toUtf8().data()); + info.replicaGroupId = query.value(2).toString().toUtf8().data(); adapterMap[info.id] = info; } } diff --git a/cpp/src/IceGrid/SqlDB/SqlStringApplicationInfoDict.cpp b/cpp/src/IceGrid/SqlDB/SqlStringApplicationInfoDict.cpp index 0e6371a27cd..974eddede1e 100644 --- a/cpp/src/IceGrid/SqlDB/SqlStringApplicationInfoDict.cpp +++ b/cpp/src/IceGrid/SqlDB/SqlStringApplicationInfoDict.cpp @@ -241,11 +241,11 @@ SqlStringApplicationInfoDict::find(const DatabaseConnectionPtr& connection, if(query.next()) { IceGrid::ApplicationInfo info; - info.uuid = query.value(1).toString().toStdString(); + info.uuid = query.value(1).toString().toUtf8().data(); info.createTime = query.value(2).toLongLong(); - info.createUser = query.value(3).toString().toStdString(); + info.createUser = query.value(3).toString().toUtf8().data(); info.updateTime = query.value(4).toLongLong(); - info.updateUser = query.value(5).toString().toStdString(); + info.updateUser = query.value(5).toString().toUtf8().data(); info.revision = query.value(6).toInt(); QByteArray bytes = query.value(7).toByteArray(); @@ -284,14 +284,14 @@ SqlStringApplicationInfoDict::getMap(const DatabaseConnectionPtr& connection, while(query.next()) { - string name = query.value(0).toString().toStdString(); + string name = query.value(0).toString().toUtf8().data(); IceGrid::ApplicationInfo info; - info.uuid = query.value(1).toString().toStdString(); + info.uuid = query.value(1).toString().toUtf8().data(); info.createTime = query.value(2).toLongLong(); - info.createUser = query.value(3).toString().toStdString(); + info.createUser = query.value(3).toString().toUtf8().data(); info.updateTime = query.value(4).toLongLong(); - info.updateUser = query.value(5).toString().toStdString(); + info.updateUser = query.value(5).toString().toUtf8().data(); info.revision = query.value(6).toInt(); QByteArray bytes = query.value(7).toByteArray(); diff --git a/cpp/src/IceStorm/SqlDB/SqlSubscriberMap.cpp b/cpp/src/IceStorm/SqlDB/SqlSubscriberMap.cpp index f50faaf7db7..8ad679f45c3 100644 --- a/cpp/src/IceStorm/SqlDB/SqlSubscriberMap.cpp +++ b/cpp/src/IceStorm/SqlDB/SqlSubscriberMap.cpp @@ -119,7 +119,7 @@ SqlSubscriberMap::QoSMap::find(const DatabaseConnectionPtr& connection, QoS qos; while(query.next()) { - qos[query.value(2).toString().toStdString()] = query.value(3).toString().toStdString(); + qos[query.value(2).toString().toUtf8().data()] = query.value(3).toString().toUtf8().data(); } return qos; } @@ -295,13 +295,13 @@ SqlSubscriberMap::find(const DatabaseConnectionPtr& connection, if(query.next()) { SubscriberRecord record; - record.topicName = query.value(2).toString().toStdString(); + record.topicName = query.value(2).toString().toUtf8().data(); record.id = key.id; - record.link = query.value(3).toString().toStdString() == "true" ? true : false; - record.obj = _communicator->stringToProxy(query.value(4).toString().toStdString()); + record.link = string(query.value(3).toString().toUtf8().data()) == "true" ? true : false; + record.obj = _communicator->stringToProxy(query.value(4).toString().toUtf8().data()); record.cost = query.value(5).toInt(); record.theTopic = - TopicPrx::uncheckedCast(_communicator->stringToProxy(query.value(6).toString().toStdString())); + TopicPrx::uncheckedCast(_communicator->stringToProxy(query.value(6).toString().toUtf8().data())); record.theQoS = _qosMap.find(connection, key); @@ -330,17 +330,17 @@ SqlSubscriberMap::getMap(const DatabaseConnectionPtr& connection, while(query.next()) { SubscriberRecordKey key; - key.topic = _communicator->stringToIdentity(query.value(0).toString().toStdString()); - key.id = _communicator->stringToIdentity(query.value(1).toString().toStdString()); + key.topic = _communicator->stringToIdentity(query.value(0).toString().toUtf8().data()); + key.id = _communicator->stringToIdentity(query.value(1).toString().toUtf8().data()); SubscriberRecord record; - record.topicName = query.value(2).toString().toStdString(); + record.topicName = query.value(2).toString().toUtf8().data(); record.id = key.id; - record.link = query.value(3).toString().toStdString() == "true" ? true : false; - record.obj = _communicator->stringToProxy(query.value(4).toString().toStdString()); + record.link = string(query.value(3).toString().toUtf8().data()) == "true" ? true : false; + record.obj = _communicator->stringToProxy(query.value(4).toString().toUtf8().data()); record.cost = query.value(5).toInt(); record.theTopic = - TopicPrx::uncheckedCast(_communicator->stringToProxy(query.value(6).toString().toStdString())); + TopicPrx::uncheckedCast(_communicator->stringToProxy(query.value(6).toString().toUtf8().data())); record.theQoS = _qosMap.find(connection, key); |