diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2007-03-26 14:49:01 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2007-03-26 14:49:01 +0000 |
commit | 737b4f7ae612af1d35b17c50dc2ed20aa7e62f25 (patch) | |
tree | 4fed4b1451ec87ac5b3fae5df5c5454a814190f9 /cppe/src | |
parent | Temporary fix (diff) | |
download | ice-737b4f7ae612af1d35b17c50dc2ed20aa7e62f25.tar.bz2 ice-737b4f7ae612af1d35b17c50dc2ed20aa7e62f25.tar.xz ice-737b4f7ae612af1d35b17c50dc2ed20aa7e62f25.zip |
Removed StringConverter
Diffstat (limited to 'cppe/src')
-rw-r--r-- | cppe/src/IceE/BasicStream.cpp | 134 | ||||
-rwxr-xr-x | cppe/src/IceE/Connection.cpp | 20 | ||||
-rw-r--r-- | cppe/src/IceE/IdentityUtil.cpp | 90 | ||||
-rw-r--r-- | cppe/src/IceE/Incoming.cpp | 25 | ||||
-rw-r--r-- | cppe/src/IceE/Initialize.cpp | 20 | ||||
-rw-r--r-- | cppe/src/IceE/Instance.cpp | 82 | ||||
-rw-r--r-- | cppe/src/IceE/Instance.h | 17 | ||||
-rwxr-xr-x | cppe/src/IceE/LocalException.cpp | 51 | ||||
-rw-r--r-- | cppe/src/IceE/Makefile | 2 | ||||
-rwxr-xr-x | cppe/src/IceE/Makefile.mak | 2 | ||||
-rw-r--r-- | cppe/src/IceE/Object.cpp | 6 | ||||
-rw-r--r-- | cppe/src/IceE/Outgoing.cpp | 10 | ||||
-rw-r--r-- | cppe/src/IceE/Properties.cpp | 29 | ||||
-rw-r--r-- | cppe/src/IceE/Proxy.cpp | 6 | ||||
-rw-r--r-- | cppe/src/IceE/Reference.cpp | 19 | ||||
-rw-r--r-- | cppe/src/IceE/ReferenceFactory.cpp | 18 | ||||
-rwxr-xr-x | cppe/src/IceE/StringConverter.cpp | 84 | ||||
-rw-r--r-- | cppe/src/IceE/TraceUtil.cpp | 4 | ||||
-rw-r--r-- | cppe/src/IceEC/Makefile | 2 | ||||
-rwxr-xr-x | cppe/src/IceEC/Makefile.mak | 2 | ||||
-rwxr-xr-x | cppe/src/Makefile.mak | 2 | ||||
-rw-r--r-- | cppe/src/TcpTransport/TcpEndpoint.cpp | 4 |
22 files changed, 57 insertions, 572 deletions
diff --git a/cppe/src/IceE/BasicStream.cpp b/cppe/src/IceE/BasicStream.cpp index 52a91cf632e..534a438d220 100644 --- a/cppe/src/IceE/BasicStream.cpp +++ b/cppe/src/IceE/BasicStream.cpp @@ -1298,65 +1298,7 @@ IceInternal::BasicStream::write(const char*) */ void -IceInternal::BasicStream::writeConverted(const string& v) -{ - // - // What is the size of the resulting UTF-8 encoded string? - // Impossible to tell, so we guess. If we don't guess correctly, - // we'll have to fix the mistake afterwards - // - - Int guessedSize = static_cast<Int>(v.size()); - writeSize(guessedSize); // writeSize() only writes the size; it does not reserve any buffer space. - - size_t firstIndex = b.size(); - StreamUTF8BufferI buffer(*this); - - Byte* lastByte = _stringConverter->toUTF8(v.data(), v.data() + v.size(), buffer); - if(lastByte != b.end()) - { - b.resize(lastByte - b.begin()); - } - size_t lastIndex = b.size(); - - Int actualSize = static_cast<Int>(lastIndex - firstIndex); - - // - // Check against the guess - // - if(guessedSize != actualSize) - { - if(guessedSize <= 254 && actualSize > 254) - { - // - // Move the UTF-8 sequence 4 bytes further - // Use memmove instead of memcpy since the source and destination typically overlap. - // - resize(b.size() + 4); - memmove(b.begin() + firstIndex + 4, b.begin() + firstIndex, actualSize); - } - else if(guessedSize > 254 && actualSize <= 254) - { - // - // Move the UTF-8 sequence 4 bytes back - // - memmove(b.begin() + firstIndex - 4, b.begin() + firstIndex, actualSize); - resize(b.size() - 4); - } - - if(guessedSize <= 254) - { - rewriteSize(actualSize, b.begin() + firstIndex - 1); - } - else - { - rewriteSize(actualSize, b.begin() + firstIndex - 1 - 4); - } - } -} - -void -IceInternal::BasicStream::write(const string* begin, const string* end, bool convert) +IceInternal::BasicStream::write(const string* begin, const string* end) { Int sz = static_cast<Int>(end - begin); writeSize(sz); @@ -1364,13 +1306,13 @@ IceInternal::BasicStream::write(const string* begin, const string* end, bool con { for(int i = 0; i < sz; ++i) { - write(begin[i], convert); + write(begin[i]); } } } void -IceInternal::BasicStream::read(vector<string>& v, bool convert) +IceInternal::BasicStream::read(vector<string>& v) { Int sz; readSize(sz); @@ -1380,7 +1322,7 @@ IceInternal::BasicStream::read(vector<string>& v, bool convert) v.resize(sz); for(int i = 0; i < sz; ++i) { - read(v[i], convert); + read(v[i]); checkSeq(); endElement(); } @@ -1393,70 +1335,6 @@ IceInternal::BasicStream::read(vector<string>& v, bool convert) } void -IceInternal::BasicStream::write(const wstring& v) -{ - if(v.size() == 0) - { - writeSize(0); - return; - } - - // - // What is the size of the resulting UTF-8 encoded string? - // Impossible to tell, so we guess. If we don't guess correctly, - // we'll have to fix the mistake afterwards - // - - Int guessedSize = static_cast<Int>(v.size()); - writeSize(guessedSize); // writeSize() only writes the size; it does not reserve any buffer space. - - size_t firstIndex = b.size(); - StreamUTF8BufferI buffer(*this); - - Byte* lastByte = _wstringConverter->toUTF8(v.data(), v.data() + v.size(), buffer); - if(lastByte != b.end()) - { - b.resize(lastByte - b.begin()); - } - size_t lastIndex = b.size(); - - Int actualSize = static_cast<Int>(lastIndex - firstIndex); - - // - // Check against the guess - // - if(guessedSize != actualSize) - { - if(guessedSize <= 254 && actualSize > 254) - { - // - // Move the UTF-8 sequence 4 bytes further - // Use memmove instead of memcpy since the source and destination typically overlap. - // - resize(b.size() + 4); - memmove(b.begin() + firstIndex + 4, b.begin() + firstIndex, actualSize); - } - else if(guessedSize > 254 && actualSize <= 254) - { - // - // Move the UTF-8 sequence 4 bytes back - // - memmove(b.begin() + firstIndex - 4, b.begin() + firstIndex, actualSize); - resize(b.size() - 4); - } - - if(guessedSize <= 254) - { - rewriteSize(actualSize, b.begin() + firstIndex - 1); - } - else - { - rewriteSize(actualSize, b.begin() + firstIndex - 1 - 4); - } - } -} - -void IceInternal::BasicStream::write(const wstring* begin, const wstring* end) { Int sz = static_cast<Int>(end - begin); @@ -1519,7 +1397,7 @@ IceInternal::BasicStream::throwException() read(usesClasses); string id; - read(id, false); + read(id); for(;;) { // @@ -1547,7 +1425,7 @@ IceInternal::BasicStream::throwException() else { skipSlice(); // Slice off what we don't understand. - read(id, false); // Read type id for next slice. + read(id); // Read type id for next slice. } } diff --git a/cppe/src/IceE/Connection.cpp b/cppe/src/IceE/Connection.cpp index 91074b02ff2..4c71ad1bb3f 100755 --- a/cppe/src/IceE/Connection.cpp +++ b/cppe/src/IceE/Connection.cpp @@ -786,8 +786,7 @@ Ice::Connection::flushBatchRequestsInternal(bool ignoreInUse) void Ice::Connection::resetBatch(bool resetInUse) { - BasicStream dummy(_instance.get(), _instance->messageSizeMax(), _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter, _batchAutoFlush); + BasicStream dummy(_instance.get(), _instance->messageSizeMax(), _batchAutoFlush); _batchStream.swap(dummy); _batchRequestNum = 0; _batchMarker = 0; @@ -1011,14 +1010,12 @@ Ice::Connection::Connection(const InstancePtr& instance, _in(_instance.get(), this, _stream, adapter), #endif #ifndef ICEE_PURE_BLOCKING_CLIENT - _stream(_instance.get(), _instance->messageSizeMax(), _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter), + _stream(_instance.get(), _instance->messageSizeMax()), #endif #ifdef ICEE_HAS_BATCH _batchAutoFlush( _instance->initializationData().properties->getPropertyAsIntWithDefault("Ice.BatchAutoFlush", 1) > 0), - _batchStream(_instance.get(), _instance->messageSizeMax(), _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter, _batchAutoFlush), + _batchStream(_instance.get(), _instance->messageSizeMax(), _batchAutoFlush), _batchStreamInUse(false), _batchRequestNum(0), _batchMarker(0), @@ -1158,9 +1155,7 @@ Ice::Connection::validate() #ifndef ICEE_PURE_CLIENT if(active) { - BasicStream os(_instance.get(), _instance->messageSizeMax(), - _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter); + BasicStream os(_instance.get(), _instance->messageSizeMax()); os.write(magic[0]); os.write(magic[1]); os.write(magic[2]); @@ -1189,9 +1184,7 @@ Ice::Connection::validate() else #endif { - BasicStream is(_instance.get(), _instance->messageSizeMax(), - _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter); + BasicStream is(_instance.get(), _instance->messageSizeMax()); is.b.resize(headerSize); is.i = is.b.begin(); try @@ -1461,8 +1454,7 @@ Ice::Connection::initiateShutdown() const // // Before we shut down, we send a close connection message. // - BasicStream os(_instance.get(), _instance->messageSizeMax(), _instance->initializationData().stringConverter, - _instance->initializationData().wstringConverter); + BasicStream os(_instance.get(), _instance->messageSizeMax()); os.write(magic[0]); os.write(magic[1]); os.write(magic[2]); diff --git a/cppe/src/IceE/IdentityUtil.cpp b/cppe/src/IceE/IdentityUtil.cpp deleted file mode 100644 index 77fb635a13c..00000000000 --- a/cppe/src/IceE/IdentityUtil.cpp +++ /dev/null @@ -1,90 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/IdentityUtil.h> -#include <IceE/LocalException.h> -#include <IceE/StringUtil.h> - -using namespace std; -using namespace Ice; -using namespace IceInternal; - -Identity -Ice::stringToIdentity(const string& s) -{ - Identity ident; - - // - // Find unescaped separator. - // - string::size_type slash = string::npos, pos = 0; - while((pos = s.find('/', pos)) != string::npos) - { - if(pos == 0 || s[pos - 1] != '\\') - { - if(slash == string::npos) - { - slash = pos; - } - else - { - // - // Extra unescaped slash found. - // - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - pos++; - } - - if(slash == string::npos) - { - if(!IceUtil::unescapeString(s, 0, s.size(), ident.name)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - else - { - if(!IceUtil::unescapeString(s, 0, slash, ident.category)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - if(slash + 1 < s.size()) - { - if(!IceUtil::unescapeString(s, slash + 1, s.size(), ident.name)) - { - IdentityParseException ex(__FILE__, __LINE__); - ex.str = s; - throw ex; - } - } - } - - return ident; -} - -string -Ice::identityToString(const Identity& ident) -{ - if(ident.category.empty()) - { - return IceUtil::escapeString(ident.name, "/"); - } - else - { - return IceUtil::escapeString(ident.category, "/") + '/' + IceUtil::escapeString(ident.name, "/"); - } -} diff --git a/cppe/src/IceE/Incoming.cpp b/cppe/src/IceE/Incoming.cpp index c851cfcef38..41ee8be76d5 100644 --- a/cppe/src/IceE/Incoming.cpp +++ b/cppe/src/IceE/Incoming.cpp @@ -24,8 +24,7 @@ using namespace Ice; using namespace IceInternal; IceInternal::Incoming::Incoming(Instance* inst, Connection* con, BasicStream& is, const ObjectAdapterPtr& adapter) : - _os(inst, inst->messageSizeMax(), inst->initializationData().stringConverter, - inst->initializationData().wstringConverter), + _os(inst, inst->messageSizeMax()), _is(is), _connection(con) { @@ -103,7 +102,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _current.facet.clear(); } - _is.read(_current.operation, false); + _is.read(_current.operation); Byte b; _is.read(b); @@ -219,7 +218,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.write(&ex.facet, &ex.facet + 1); } - _os.write(ex.operation, false); + _os.write(ex.operation); _connection->sendResponse(&_os); } @@ -244,7 +243,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownLocalException)); - _os.write(ex.unknown, false); + _os.write(ex.unknown); _connection->sendResponse(&_os); } else @@ -268,7 +267,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownUserException)); - _os.write(ex.unknown, false); + _os.write(ex.unknown); _connection->sendResponse(&_os); } else @@ -292,7 +291,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownException)); - _os.write(ex.unknown, false); + _os.write(ex.unknown); _connection->sendResponse(&_os); } else @@ -316,7 +315,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownLocalException)); - _os.write(ex.toString(), false); + _os.write(ex.toString()); _connection->sendResponse(&_os); } else @@ -340,7 +339,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownUserException)); - _os.write(ex.toString(), false); + _os.write(ex.toString()); _connection->sendResponse(&_os); } else @@ -364,7 +363,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownException)); - _os.write(ex.toString(), false); + _os.write(ex.toString()); _connection->sendResponse(&_os); } else @@ -389,7 +388,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownException)); string msg = string("std::exception: ") + ex.what(); - _os.write(msg, false); + _os.write(msg); _connection->sendResponse(&_os); } else @@ -413,7 +412,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.endWriteEncaps(); _os.b.resize(headerSize + 4); // Dispatch status position. _os.write(static_cast<Byte>(DispatchUnknownException)); - _os.write(string("unknown c++ exception"), false); + _os.write(string("unknown c++ exception")); _connection->sendResponse(&_os); } else @@ -459,7 +458,7 @@ IceInternal::Incoming::invoke(bool response, Int requestId) _os.write(&_current.facet, &_current.facet + 1); } - _os.write(_current.operation, false); + _os.write(_current.operation); } else { diff --git a/cppe/src/IceE/Initialize.cpp b/cppe/src/IceE/Initialize.cpp index cfd407dc042..2ccd9fd426a 100644 --- a/cppe/src/IceE/Initialize.cpp +++ b/cppe/src/IceE/Initialize.cpp @@ -61,22 +61,22 @@ Ice::stringSeqToArgs(const StringSeq& args, int& argc, char* argv[]) } PropertiesPtr -Ice::createProperties(const StringConverterPtr& converter) +Ice::createProperties() { - return new Properties(converter); + return new Properties(); } PropertiesPtr -Ice::createProperties(StringSeq& args, const PropertiesPtr& defaults, const StringConverterPtr& converter) +Ice::createProperties(StringSeq& args, const PropertiesPtr& defaults) { - return new Properties(args, defaults, converter); + return new Properties(args, defaults); } PropertiesPtr -Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults, const StringConverterPtr& converter) +Ice::createProperties(int& argc, char* argv[], const PropertiesPtr& defaults) { StringSeq args = argsToStringSeq(argc, argv); - PropertiesPtr properties = createProperties(args, defaults, converter); + PropertiesPtr properties = createProperties(args, defaults); stringSeqToArgs(args, argc, argv); return properties; } @@ -182,14 +182,6 @@ Ice::initialize(const InitializationData& initData, Int version) return communicator; } -CommunicatorPtr -Ice::initializeWithProperties(int& argc, char* argv[], const PropertiesPtr& properties, Int version) -{ - InitializationData initData; - initData.properties = properties; - return initialize(argc, argv, initData, version); -} - InstancePtr IceInternal::getInstance(const CommunicatorPtr& communicator) { diff --git a/cppe/src/IceE/Instance.cpp b/cppe/src/IceE/Instance.cpp index e839093c4b3..f5cceb491b5 100644 --- a/cppe/src/IceE/Instance.cpp +++ b/cppe/src/IceE/Instance.cpp @@ -307,48 +307,19 @@ IceInternal::Instance::stringToIdentity(const string& s) const } } - if(_initData.stringConverter) - { - string tmpString; - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.name.data()), - reinterpret_cast<const Byte*>(ident.name.data() + ident.name.size()), - tmpString); - ident.name = tmpString; - - _initData.stringConverter->fromUTF8(reinterpret_cast<const Byte*>(ident.category.data()), - reinterpret_cast<const Byte*>(ident.category.data() + ident.category.size()), - tmpString); - ident.category = tmpString; - } - return ident; } string IceInternal::Instance::identityToString(const Identity& ident) const { - string name = ident.name; - string category = ident.category; - if(_initData.stringConverter) - { - UTF8BufferI buffer; - Byte* last = _initData.stringConverter->toUTF8(ident.name.data(), ident.name.data() + ident.name.size(), - buffer); - name = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - - buffer.reset(); - last = _initData.stringConverter->toUTF8(ident.category.data(), ident.category.data() + ident.category.size(), - buffer); - category = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } - - if(category.empty()) + if(ident.category.empty()) { - return IceUtil::escapeString(name, "/"); + return IceUtil::escapeString(ident.name, "/"); } else { - return IceUtil::escapeString(category, "/") + '/' + IceUtil::escapeString(name, "/"); + return IceUtil::escapeString(ident.category, "/") + '/' + IceUtil::escapeString(ident.name, "/"); } } @@ -540,11 +511,6 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _objectAdapterFactory = new ObjectAdapterFactory(this, communicator); #endif - if(!_initData.wstringConverter) - { - _initData.wstringConverter = new UnicodeWstringConverter(); - } - __setNoDelete(false); } catch(...) @@ -743,45 +709,3 @@ IceInternal::Instance::destroy() _state = StateDestroyed; }
} - -IceInternal::UTF8BufferI::UTF8BufferI() : - _buffer(0), - _offset(0) -{ -} - -IceInternal::UTF8BufferI::~UTF8BufferI() -{ - free(_buffer); -} - -Byte* -IceInternal::UTF8BufferI::getMoreBytes(size_t howMany, Byte* firstUnused) -{ - if(_buffer == 0) - { - _buffer = (Byte*)malloc(howMany); - } - else - { - assert(firstUnused != 0); - _offset = firstUnused - _buffer; - _buffer = (Byte*)realloc(_buffer, _offset + howMany); - } - - return _buffer + _offset; -} - -Byte* -IceInternal::UTF8BufferI::getBuffer() -{ - return _buffer; -} - -void -IceInternal::UTF8BufferI::reset() -{ - free(_buffer); - _buffer = 0; - _offset = 0; -} diff --git a/cppe/src/IceE/Instance.h b/cppe/src/IceE/Instance.h index ebc91e237f8..db381c3ddb9 100644 --- a/cppe/src/IceE/Instance.h +++ b/cppe/src/IceE/Instance.h @@ -112,23 +112,6 @@ private: SharedContextPtr _defaultContext; }; -class UTF8BufferI : public Ice::UTF8Buffer -{ -public: - - UTF8BufferI(); - ~UTF8BufferI(); - - Ice::Byte* getMoreBytes(size_t howMany, Ice::Byte* firstUnused); - Ice::Byte* getBuffer(); - void reset(); - -private: - - Ice::Byte* _buffer; - size_t _offset; -}; - } #endif diff --git a/cppe/src/IceE/LocalException.cpp b/cppe/src/IceE/LocalException.cpp index cfcfd7ac37e..17498ad356b 100755 --- a/cppe/src/IceE/LocalException.cpp +++ b/cppe/src/IceE/LocalException.cpp @@ -1879,49 +1879,6 @@ Ice::MemoryLimitException::ice_throw() const throw *this; } - -Ice::StringConversionException::StringConversionException(const char* __file, int __line) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line) -#else - ::Ice::MarshalException(__file, __line) -#endif -{ -} - -Ice::StringConversionException::StringConversionException(const char* __file, int __line, const ::std::string& __reason) : -#if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug - MarshalException(__file, __line, __reason) -#else - ::Ice::MarshalException(__file, __line, __reason) -#endif -{ -} - -Ice::StringConversionException::~StringConversionException() throw() -{ -} - -static const char* __Ice__StringConversionException_name = "Ice::StringConversionException"; - -::std::string -Ice::StringConversionException::ice_name() const -{ - return __Ice__StringConversionException_name; -} - -::Ice::Exception* -Ice::StringConversionException::ice_clone() const -{ - return new StringConversionException(*this); -} - -void -Ice::StringConversionException::ice_throw() const -{ - throw *this; -} - Ice::EncapsulationException::EncapsulationException(const char* __file, int __line) : #if defined(_MSC_VER) && (_MSC_VER < 1300) // VC++ 6 compiler bug MarshalException(__file, __line) @@ -2439,14 +2396,6 @@ Ice::MemoryLimitException::toString() const } string -Ice::StringConversionException::toString() const -{ - string out = Exception::toString(); - out += ":\nprotocol error: string conversion failed"; - return out; -} - -string Ice::EncapsulationException::toString() const { string out = Exception::toString(); diff --git a/cppe/src/IceE/Makefile b/cppe/src/IceE/Makefile index bf96354d44e..9983f3acba3 100644 --- a/cppe/src/IceE/Makefile +++ b/cppe/src/IceE/Makefile @@ -41,7 +41,6 @@ LOCAL_OBJS = BasicStream.o \ FactoryTable.o \ FactoryTableDef.o \ Identity.o \ - IdentityUtil.o \ Incoming.o \ IncomingConnectionFactory.o \ Initialize.o \ @@ -74,7 +73,6 @@ LOCAL_OBJS = BasicStream.o \ ServantManager.o \ Shared.o \ StaticMutex.o \ - StringConverter.o \ StringUtil.o \ Thread.o \ ThreadException.o \ diff --git a/cppe/src/IceE/Makefile.mak b/cppe/src/IceE/Makefile.mak index 9fd181595f9..04026967b3b 100755 --- a/cppe/src/IceE/Makefile.mak +++ b/cppe/src/IceE/Makefile.mak @@ -37,7 +37,6 @@ LOCAL_OBJS = BasicStream.obj \ FactoryTable.obj \ FactoryTableDef.obj \ Identity.obj \ - IdentityUtil.obj \ Incoming.obj \ IncomingConnectionFactory.obj \ Initialize.obj \ @@ -70,7 +69,6 @@ LOCAL_OBJS = BasicStream.obj \ ServantManager.obj \ Shared.obj \ StaticMutex.obj \ - StringConverter.obj \ StringUtil.obj \ Thread.obj \ ThreadException.obj \ diff --git a/cppe/src/IceE/Object.cpp b/cppe/src/IceE/Object.cpp index 13c163687eb..55559111b38 100644 --- a/cppe/src/IceE/Object.cpp +++ b/cppe/src/IceE/Object.cpp @@ -90,7 +90,7 @@ Ice::Object::___ice_isA(Incoming& __inS, const Current& __current) BasicStream* __is = __inS.is(); BasicStream* __os = __inS.os(); string __id; - __is->read(__id, false); + __is->read(__id); bool __ret = ice_isA(__id, __current); __os->write(__ret); return DispatchOK; @@ -108,7 +108,7 @@ Ice::Object::___ice_ids(Incoming& __inS, const Current& __current) { BasicStream* __os = __inS.os(); vector<string> __ret = ice_ids(__current); - __os->write(&__ret[0], &__ret[0] + __ret.size(), false); + __os->write(&__ret[0], &__ret[0] + __ret.size()); return DispatchOK; } @@ -117,7 +117,7 @@ Ice::Object::___ice_id(Incoming& __inS, const Current& __current) { BasicStream* __os = __inS.os(); string __ret = ice_id(__current); - __os->write(__ret, false); + __os->write(__ret); return DispatchOK; } diff --git a/cppe/src/IceE/Outgoing.cpp b/cppe/src/IceE/Outgoing.cpp index 5a5c775674d..2dc7074d463 100644 --- a/cppe/src/IceE/Outgoing.cpp +++ b/cppe/src/IceE/Outgoing.cpp @@ -49,9 +49,7 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st _connection(connection), _reference(ref), _state(StateUnsent), - _stream(ref->getInstance().get(), ref->getInstance()->messageSizeMax(), - ref->getInstance()->initializationData().stringConverter, - ref->getInstance()->initializationData().wstringConverter) + _stream(ref->getInstance().get(), ref->getInstance()->messageSizeMax()) { switch(_reference->getMode()) { @@ -96,7 +94,7 @@ IceInternal::Outgoing::Outgoing(Connection* connection, Reference* ref, const st _stream.write(_reference->getFacet()); } - _stream.write(operation, false); + _stream.write(operation); _stream.write(static_cast<Byte>(mode)); @@ -309,7 +307,7 @@ IceInternal::Outgoing::finished(BasicStream& is) } string operation; - _stream.read(operation, false); + _stream.read(operation); RequestFailedException* ex; switch(static_cast<DispatchStatus>(status)) @@ -359,7 +357,7 @@ IceInternal::Outgoing::finished(BasicStream& is) // exception, you will have a memory leak. // string unknown; - _stream.read(unknown, false); + _stream.read(unknown); UnknownException* ex; switch(static_cast<DispatchStatus>(status)) diff --git a/cppe/src/IceE/Properties.cpp b/cppe/src/IceE/Properties.cpp index 1a44c32b180..35800e1a107 100644 --- a/cppe/src/IceE/Properties.cpp +++ b/cppe/src/IceE/Properties.cpp @@ -159,7 +159,7 @@ Ice::Properties::parseCommandLineOptions(const string& prefix, const StringSeq& opt += "=1"; } - parseLine(opt.substr(2), 0); + parseLine(opt.substr(2)); } else { @@ -190,7 +190,7 @@ Ice::Properties::load(const std::string& file) char line[1024]; while(fgets(line, 1024, in) != NULL) { - parseLine(line, _converter); + parseLine(line); } fclose(in); } @@ -203,18 +203,15 @@ Ice::Properties::clone() } Ice::Properties::Properties(const Properties* p) : - _properties(p->_properties), - _converter(p->_converter) + _properties(p->_properties) { } -Ice::Properties::Properties(const StringConverterPtr& converter) : - _converter(converter) +Ice::Properties::Properties() { } -Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults, const StringConverterPtr& converter) : - _converter(converter) +Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults) { if(defaults != 0) { @@ -245,7 +242,7 @@ Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults, cons { s += "=1"; } - parseLine(s.substr(2), 0); + parseLine(s.substr(2)); loadConfigFiles = true; } else @@ -273,7 +270,7 @@ Ice::Properties::Properties(StringSeq& args, const PropertiesPtr& defaults, cons } void -Ice::Properties::parseLine(const string& line, const StringConverterPtr& converter) +Ice::Properties::parseLine(const string& line) { const string delim = " \t\r\n"; string s = line; @@ -319,18 +316,6 @@ Ice::Properties::parseLine(const string& line, const StringConverterPtr& convert value = s.substr(beg, end - beg); } - if(converter) - { - string tmp; - converter->fromUTF8(reinterpret_cast<const Byte*>(key.data()), - reinterpret_cast<const Byte*>(key.data() + key.size()), tmp); - key.swap(tmp); - - converter->fromUTF8(reinterpret_cast<const Byte*>(value.data()), - reinterpret_cast<const Byte*>(value.data() + value.size()), tmp); - value.swap(tmp); - } - setProperty(key, value); } diff --git a/cppe/src/IceE/Proxy.cpp b/cppe/src/IceE/Proxy.cpp index 6c0c186e89a..06fe399d8ba 100644 --- a/cppe/src/IceE/Proxy.cpp +++ b/cppe/src/IceE/Proxy.cpp @@ -196,7 +196,7 @@ IceProxy::Ice::Object::ice_isA(const string& __id, const Context& __context) BasicStream* __stream = __og.stream(); try { - __stream->write(__id, false); + __stream->write(__id); } catch(const ::Ice::LocalException& __ex) { @@ -346,7 +346,7 @@ IceProxy::Ice::Object::ice_ids(const Context& __context) throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); } } - __is->read(__ret, false); + __is->read(__ret); } catch(const ::Ice::LocalException& __ex) { @@ -412,7 +412,7 @@ IceProxy::Ice::Object::ice_id(const Context& __context) throw ::Ice::UnknownUserException(__FILE__, __LINE__, __ex.ice_name()); } } - __is->read(__ret, false); + __is->read(__ret); } catch(const ::Ice::LocalException& __ex) { diff --git a/cppe/src/IceE/Reference.cpp b/cppe/src/IceE/Reference.cpp index c64f85255bc..859bae7755c 100644 --- a/cppe/src/IceE/Reference.cpp +++ b/cppe/src/IceE/Reference.cpp @@ -217,15 +217,7 @@ IceInternal::Reference::toString() const // the reference parser uses as separators, then we enclose // the facet string in quotes. // - string fs = _facet; - if(_instance->initializationData().stringConverter) - { - UTF8BufferI buffer; - Byte* last = - _instance->initializationData().stringConverter->toUTF8(fs.data(), fs.data() + fs.size(), buffer); - fs = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } - fs = IceUtil::escapeString(fs, ""); + string fs = IceUtil::escapeString(_facet, ""); if(fs.find_first_of(" :@") != string::npos) { s += "\""; @@ -1011,14 +1003,7 @@ IceInternal::IndirectReference::toString() const // reference parser uses as separators, then we enclose the // adapter id string in quotes. // - string a = _adapterId; - if(getInstance()->initializationData().stringConverter) - { - UTF8BufferI buffer; - Byte* last = getInstance()->initializationData().stringConverter->toUTF8(a.data(), a.data() + a.size(), buffer); - a = string(reinterpret_cast<const char*>(buffer.getBuffer()), last - buffer.getBuffer()); - } - a = IceUtil::escapeString(a, ""); + string a = IceUtil::escapeString(_adapterId, ""); if(a.find_first_of(" ") != string::npos) { result.append("\""); diff --git a/cppe/src/IceE/ReferenceFactory.cpp b/cppe/src/IceE/ReferenceFactory.cpp index f797e43f494..c9689fdd218 100644 --- a/cppe/src/IceE/ReferenceFactory.cpp +++ b/cppe/src/IceE/ReferenceFactory.cpp @@ -337,15 +337,6 @@ IceInternal::ReferenceFactory::create(const string& str) throw ex; } - if(_instance->initializationData().stringConverter) - { - string tmpFacet; - _instance->initializationData().stringConverter->fromUTF8( - reinterpret_cast<const Byte*>(facet.data()), - reinterpret_cast<const Byte*>(facet.data() + facet.size()), tmpFacet); - facet = tmpFacet; - } - break; } @@ -549,15 +540,6 @@ IceInternal::ReferenceFactory::create(const string& str) throw ex; } - if(_instance->initializationData().stringConverter) - { - string tmpAdapter; - _instance->initializationData().stringConverter->fromUTF8( - reinterpret_cast<const Byte*>(adapter.data()), - reinterpret_cast<const Byte*>(adapter.data() + adapter.size()), tmpAdapter); - adapter = tmpAdapter; - } - #ifdef ICEE_HAS_ROUTER return create(ident, _instance->getDefaultContext(), facet, mode, secure, adapter, routerInfo, locatorInfo); diff --git a/cppe/src/IceE/StringConverter.cpp b/cppe/src/IceE/StringConverter.cpp deleted file mode 100755 index 050f570295a..00000000000 --- a/cppe/src/IceE/StringConverter.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// ********************************************************************** -// -// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved. -// -// This copy of Ice-E is licensed to you under the terms described in the -// ICEE_LICENSE file included in this distribution. -// -// ********************************************************************** - -#include <IceE/StringConverter.h> -#include <IceE/Unicode.h> -#include <IceE/LocalException.h> - -using namespace IceUtil; -using namespace std; - -namespace Ice -{ - -Byte* -UnicodeWstringConverter::toUTF8(const wchar_t* sourceStart, - const wchar_t* sourceEnd, - UTF8Buffer& buffer) const -{ - // - // The "chunk size" is the maximum of the number of characters in the - // source and 6 (== max bytes necessary to encode one Unicode character). - // - size_t chunkSize = std::max<size_t>(static_cast<size_t>(sourceEnd - sourceStart), 6); - - Byte* targetStart = buffer.getMoreBytes(chunkSize, 0); - Byte* targetEnd = targetStart + chunkSize; - - ConversionResult result; - - while((result = - convertUTFWstringToUTF8(sourceStart, sourceEnd, - targetStart, targetEnd, lenientConversion)) - == targetExhausted) - { - targetStart = buffer.getMoreBytes(chunkSize, targetStart); - targetEnd = targetStart + chunkSize; - } - - switch(result) - { - case conversionOK: - break; - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "wide string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "wide string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } - } - return targetStart; -} - -void -UnicodeWstringConverter::fromUTF8(const Byte* sourceStart, const Byte* sourceEnd, - wstring& target) const -{ - ConversionResult result = - convertUTF8ToUTFWstring(sourceStart, sourceEnd, target, lenientConversion); - - switch(result) - { - case conversionOK: - break; - case sourceExhausted: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source exhausted"); - case sourceIllegal: - throw StringConversionException(__FILE__, __LINE__, "UTF-8 string source illegal"); - default: - { - assert(0); - throw StringConversionException(__FILE__, __LINE__); - } - } -} -} diff --git a/cppe/src/IceE/TraceUtil.cpp b/cppe/src/IceE/TraceUtil.cpp index a86e5aab55a..ef383572f80 100644 --- a/cppe/src/IceE/TraceUtil.cpp +++ b/cppe/src/IceE/TraceUtil.cpp @@ -40,7 +40,7 @@ printIdentityFacetOperation(string& s, BasicStream& stream) } string operation; - stream.read(operation, false); + stream.read(operation); s += "\noperation = "; s += operation; } @@ -367,7 +367,7 @@ IceInternal::traceReply(const char* heading, const BasicStream& str, const Logge } string unknown; - stream.read(unknown, false); + stream.read(unknown); s += "\nunknown = "; s += unknown; break; diff --git a/cppe/src/IceEC/Makefile b/cppe/src/IceEC/Makefile index 67d784e9d22..28410cf337a 100644 --- a/cppe/src/IceEC/Makefile +++ b/cppe/src/IceEC/Makefile @@ -35,7 +35,6 @@ ICE_OBJS = BasicStream.o \ ExceptionBase.o \ FactoryTable.o \ FactoryTableDef.o \ - IdentityUtil.o \ Initialize.o \ Instance.o \ LocalException.o \ @@ -59,7 +58,6 @@ ICE_OBJS = BasicStream.o \ SafeStdio.o \ Shared.o \ StaticMutex.o \ - StringConverter.o \ StringUtil.o \ Thread.o \ ThreadException.o \ diff --git a/cppe/src/IceEC/Makefile.mak b/cppe/src/IceEC/Makefile.mak index ed7e05a446b..8aa2725ac32 100755 --- a/cppe/src/IceEC/Makefile.mak +++ b/cppe/src/IceEC/Makefile.mak @@ -35,7 +35,6 @@ ICEE_OBJS = BasicStream.obj \ FactoryTable.obj \ FactoryTableDef.obj \ Identity.obj \ - IdentityUtil.obj \ Initialize.obj \ Instance.obj \ LocalException.obj \ @@ -62,7 +61,6 @@ ICEE_OBJS = BasicStream.obj \ SafeStdio.obj \ Shared.obj \ StaticMutex.obj \ - StringConverter.obj \ StringUtil.obj \ Thread.obj \ ThreadException.obj \ diff --git a/cppe/src/Makefile.mak b/cppe/src/Makefile.mak index 8f045983ad3..24a12c431b4 100755 --- a/cppe/src/Makefile.mak +++ b/cppe/src/Makefile.mak @@ -18,4 +18,4 @@ $(EVERYTHING):: @for %i in ( $(SUBDIRS) ) do \ @if exist %i \ @echo "making $@ in %i" & \ - cmd /c "cd %i & $(MAKE) -nologo -f Makefile.mak $@" + cmd /c "cd %i & $(MAKE) -nologo -f Makefile.mak $@ || exit 1" diff --git a/cppe/src/TcpTransport/TcpEndpoint.cpp b/cppe/src/TcpTransport/TcpEndpoint.cpp index 4f09591f604..54b7fa6ba62 100644 --- a/cppe/src/TcpTransport/TcpEndpoint.cpp +++ b/cppe/src/TcpTransport/TcpEndpoint.cpp @@ -142,7 +142,7 @@ IceInternal::TcpEndpoint::TcpEndpoint(BasicStream* s) : bool dummy; s->startReadEncaps(); - s->read(const_cast<string&>(_host), false); + s->read(const_cast<string&>(_host)); s->read(const_cast<Int&>(_port)); s->read(const_cast<Int&>(_timeout)); s->read(const_cast<bool&>(dummy)); @@ -154,7 +154,7 @@ IceInternal::TcpEndpoint::streamWrite(BasicStream* s) const { s->write(TcpEndpointType); s->startWriteEncaps(); - s->write(_host, false); + s->write(_host); s->write(_port); s->write(_timeout); s->write(false); |