diff options
author | Marc Laukien <marc@zeroc.com> | 2002-04-03 21:22:52 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2002-04-03 21:22:52 +0000 |
commit | 4178ad80a3978cfbd2f53a7e47bf0120ded7d4d5 (patch) | |
tree | 94813a418f0973f780a2620d70e975a97bfc8b6d /cpp/src/IcePatch/NodeI.cpp | |
parent | started with IcePatch (diff) | |
download | ice-4178ad80a3978cfbd2f53a7e47bf0120ded7d4d5.tar.bz2 ice-4178ad80a3978cfbd2f53a7e47bf0120ded7d4d5.tar.xz ice-4178ad80a3978cfbd2f53a7e47bf0120ded7d4d5.zip |
started with IcePatch
Diffstat (limited to 'cpp/src/IcePatch/NodeI.cpp')
-rw-r--r-- | cpp/src/IcePatch/NodeI.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/cpp/src/IcePatch/NodeI.cpp b/cpp/src/IcePatch/NodeI.cpp new file mode 100644 index 00000000000..0c41b31f562 --- /dev/null +++ b/cpp/src/IcePatch/NodeI.cpp @@ -0,0 +1,71 @@ +// ********************************************************************** +// +// Copyright (c) 2002 +// MutableRealms, Inc. +// Huntsville, AL, USA +// +// All Rights Reserved +// +// ********************************************************************** + +#include <IcePatch/NodeI.h> + +using namespace std; +using namespace Ice; +using namespace IcePatch; + +string +IcePatch::NodeI::normalizePath(const string& path) +{ + string result = path; + + string::size_type pos; + + for (pos = 0; pos < result.size(); ++pos) + { + if (result[pos] == '\\') + { + result[pos] = '/'; + } + } + + pos = 0; + while ((pos = result.find("//", pos)) != string::npos) + { + result.erase(pos, 1); + } + + pos = 0; + while ((pos = result.find("/./", pos)) != string::npos) + { + result.erase(pos, 2); + } + + return result; +} + +Nodes +IcePatch::DirectoryI::getNodes(const Ice::Current& current) +{ + // + // No synchronization necessary, this servant is completely + // stateless. + // + + string path = normalizePath(current.identity.name); + + return Nodes(); +} + +ByteSeq +IcePatch::FileI::getBytes(Int startPos, Int howMuch, const Ice::Current& current) +{ + // + // No synchronization necessary, this servant is completely + // stateless. + // + + string path = normalizePath(current.identity.name); + + return ByteSeq(); +} |