~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/test/old/testfilepath.cc

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2012-07-16 09:56:24 UTC
  • mfrom: (0.3.11)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: package-import@ubuntu.com-20120716095624-azr2w4hbhei1rxmx
Tags: upstream-0.48
ImportĀ upstreamĀ versionĀ 0.48

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include "include/filepath.h"
 
3
#include <iostream>
 
4
using namespace std;
 
5
 
 
6
int print(string s) {
 
7
  filepath fp = s;
 
8
  cout << "s = " << s << "   filepath = " << fp << endl;
 
9
  cout << "  depth " << fp.depth() << endl;
 
10
  for (int i=0; i<fp.depth(); i++) {
 
11
    cout << "\t" << i << " " << fp[i] << endl;
 
12
  }
 
13
}
 
14
 
 
15
int main() {
 
16
  filepath p;
 
17
  print("/home/sage");
 
18
  print("a/b/c");
 
19
  print("/a/b/c");
 
20
  print("/a/b/c/");
 
21
  print("/a/b/../d");
 
22
}