summaryrefslogtreecommitdiffstats
path: root/src/test/old/testfilepath.cc
blob: 78ecc197f6d6311047b3b5376a483bd4c0576935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "include/filepath.h"
#include <iostream>
using namespace std;

int print(const string &s) {
  filepath fp = s;
  cout << "s = " << s << "   filepath = " << fp << endl;
  cout << "  depth " << fp.depth() << endl;
  for (int i=0; i<fp.depth(); i++) {
    cout << "\t" << i << " " << fp[i] << endl;
  }
}

int main() {
  filepath p;
  print("/home/sage");
  print("a/b/c");
  print("/a/b/c");
  print("/a/b/c/");
  print("/a/b/../d");
}