src/common/trace-resolver.cc
changeset 1328 03f1081c21a7
parent 1325 f3be9eed2d90
child 1329 fc842b2faece
--- a/src/common/trace-resolver.cc	Fri Aug 10 14:14:29 2007 +0200
+++ b/src/common/trace-resolver.cc	Fri Aug 10 14:25:58 2007 +0200
@@ -80,6 +80,34 @@
   resolverList.erase (resolverList.begin (), resolverList.end ());
 }
 
+std::string 
+TraceResolver::GetElement (std::string path)
+{
+  std::string::size_type cur = 1;
+  // check that first char is "/"
+  std::string::size_type next = path.find ("/", cur);
+  std::string id = std::string (path, cur, next-1);
+  return id;
+}
+std::string 
+TraceResolver::GetSubpath (std::string path)
+{
+  std::string::size_type cur = 1;
+  // check that first char is "/"
+  std::string::size_type next = path.find ("/", cur);
+  std::string subpath;
+  if (next != std::string::npos)
+    {
+      subpath = std::string (path, next, std::string::npos);
+    }
+  else
+    {
+      subpath = "";
+    }
+  return subpath;
+}
+
+
 TraceResolver::TraceResolverList 
 TraceResolver::DoLookup (std::string id) const
 {