1
0
mirror of https://github.com/Zygo/bees.git synced 2025-06-16 17:46:16 +02:00

bees: remove local cruft, throw at github

This commit is contained in:
Zygo Blaxell
2016-11-15 23:32:44 -05:00
commit cca0ee26a8
66 changed files with 12785 additions and 0 deletions

26
lib/path.cc Normal file
View File

@ -0,0 +1,26 @@
#include "crucible/path.h"
#include "crucible/error.h"
namespace crucible {
using namespace std;
string
basename(string s)
{
size_t left = s.find_last_of("/");
size_t right = s.find_last_not_of("/");
if (left == string::npos) {
return s;
}
return s.substr(left + 1, right);
}
string
join(string dir, string base)
{
// TODO: a lot of sanity checking, maybe canonicalization
return dir + "/" + base;
}
};