summaryrefslogtreecommitdiff
path: root/cpp/src/IcePatch/NodeI.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2002-04-03 21:22:52 +0000
committerMarc Laukien <marc@zeroc.com>2002-04-03 21:22:52 +0000
commit4178ad80a3978cfbd2f53a7e47bf0120ded7d4d5 (patch)
tree94813a418f0973f780a2620d70e975a97bfc8b6d /cpp/src/IcePatch/NodeI.cpp
parentstarted with IcePatch (diff)
downloadice-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.cpp71
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();
+}