diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2008-01-09 10:46:08 -0330 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2008-01-09 10:46:08 -0330 |
commit | f24e7084d5ebce8689e02d5f322d175d4108cf00 (patch) | |
tree | c484017689764bed48fa846be070d168ff469d64 /cpp/src/Slice/RubyUtil.cpp | |
parent | Finished fixes for bug 2132 (diff) | |
download | ice-f24e7084d5ebce8689e02d5f322d175d4108cf00.tar.bz2 ice-f24e7084d5ebce8689e02d5f322d175d4108cf00.tar.xz ice-f24e7084d5ebce8689e02d5f322d175d4108cf00.zip |
Use mcpp instead of icecpp
Diffstat (limited to 'cpp/src/Slice/RubyUtil.cpp')
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index 47bf17f6c52..1b078e08b7d 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -9,6 +9,7 @@ #include <Slice/RubyUtil.h> #include <Slice/Checksum.h> +#include <Slice/Util.h> #include <IceUtil/Functional.h> #include <IceUtil/InputUtil.h> @@ -1588,23 +1589,11 @@ Slice::Ruby::CodeVisitor::collectExceptionMembers(const ExceptionPtr& p, MemberI } static string -normalizePath(const string& path) -{ - string result = path; - replace(result.begin(), result.end(), '\\', '/'); - string::size_type pos; - while((pos = result.find("//")) != string::npos) - { - result.replace(pos, 2, "/"); - } - return result; -} - -static string changeInclude(const string& inc, const vector<string>& includePaths) { string orig = normalizePath(inc); string curr = orig; // The current shortest pathname. + string cwd = getCwd(); // // Compare the pathname of the included file against each of the include directories. @@ -1614,10 +1603,15 @@ changeInclude(const string& inc, const vector<string>& includePaths) for(vector<string>::const_iterator p = includePaths.begin(); p != includePaths.end(); ++p) { string includePath = *p; + if(isAbsolute(orig) && !isAbsolute(includePath)) + { + includePath = cwd + "/" + includePath; + } + includePath = normalizePath(includePath); - if(orig.compare(0, p->size(), *p) == 0) + if(orig.compare(0, includePath.size(), includePath) == 0) { - string s = orig.substr(p->size()); + string s = orig.substr(includePath.size()); if(s.size() < curr.size()) { curr = s; |