diff options
author | Marc Laukien <marc@zeroc.com> | 2004-04-07 00:13:35 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2004-04-07 00:13:35 +0000 |
commit | d702a6bd170669e2b959ae49b24224c72ab8f367 (patch) | |
tree | 0109385349191c72a45cb2c3860ace90f0702d18 /cpp/src/Ice/ReferenceFactory.cpp | |
parent | facet changes (diff) | |
download | ice-d702a6bd170669e2b959ae49b24224c72ab8f367.tar.bz2 ice-d702a6bd170669e2b959ae49b24224c72ab8f367.tar.xz ice-d702a6bd170669e2b959ae49b24224c72ab8f367.zip |
facet changes
Diffstat (limited to 'cpp/src/Ice/ReferenceFactory.cpp')
-rw-r--r-- | cpp/src/Ice/ReferenceFactory.cpp | 65 |
1 files changed, 15 insertions, 50 deletions
diff --git a/cpp/src/Ice/ReferenceFactory.cpp b/cpp/src/Ice/ReferenceFactory.cpp index b3782c18f4c..b1714ad1355 100644 --- a/cpp/src/Ice/ReferenceFactory.cpp +++ b/cpp/src/Ice/ReferenceFactory.cpp @@ -33,7 +33,7 @@ void IceInternal::decRef(::IceInternal::ReferenceFactory* p) { p->__decRef(); } ReferencePtr IceInternal::ReferenceFactory::create(const Identity& ident, const Context& context, - const vector<string>& facet, + const string& facet, Reference::Mode mode, bool secure, const string& adapterId, @@ -215,7 +215,7 @@ IceInternal::ReferenceFactory::create(const string& str) } } - vector<string> facet; + string facet; Reference::Mode mode = Reference::ModeTwoway; bool secure = false; string adapter; @@ -304,55 +304,12 @@ IceInternal::ReferenceFactory::create(const string& str) throw ex; } - const string::size_type argLen = argument.size(); - - string::size_type argBeg = 0; - while(argBeg < argLen) - { - // - // Skip slashes - // - argBeg = argument.find_first_not_of("/", argBeg); - if(argBeg == string::npos) - { - break; - } - - // - // Find unescaped slash - // - string::size_type argEnd = argBeg; - while((argEnd = argument.find('/', argEnd)) != string::npos) - { - if(argument[argEnd - 1] != '\\') - { - break; - } - argEnd++; - } - - if(argEnd == string::npos) - { - argEnd = argLen; - } - - string token; - if(!decodeString(argument, argBeg, argEnd, token)) - { - ProxyParseException ex(__FILE__, __LINE__); - ex.str = str; - throw ex; - } - facet.push_back(token); - argBeg = argEnd + 1; - } - - if(facet.size() == 0) - { + if(!decodeString(argument, 0, argument.size(), facet)) + { ProxyParseException ex(__FILE__, __LINE__); ex.str = str; throw ex; - } + } break; } @@ -517,8 +474,16 @@ IceInternal::ReferenceFactory::create(const Identity& ident, BasicStream* s) return 0; } - vector<string> facet; - s->read(facet); + // + // For compatibility with the old FacetPath. + // + vector<string> facetPath; + s->read(facetPath); + string facet; + if(!facetPath.empty()) // TODO: Throw an exception if facetPath has more than one element? + { + facet.swap(facetPath[0]); + } Byte modeAsByte; s->read(modeAsByte); |