2014-12-16 18:07:37 +00:00
|
|
|
#ifndef __fs_spec_h__
|
|
|
|
#define __fs_spec_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <deque>
|
|
|
|
|
|
|
|
namespace OS {
|
|
|
|
|
|
|
|
class FSSpecManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
static std::string ExpandPath(const std::string &path, int32_t id);
|
|
|
|
static const std::string &PathForID(int32_t id);
|
|
|
|
static int32_t IDForPath(const std::string &path, bool insert = true);
|
|
|
|
static int32_t IDForPath(std::string &&path, bool insert = true);
|
|
|
|
|
2015-01-18 19:28:05 +00:00
|
|
|
static int32_t IDForCWD();
|
|
|
|
|
2014-12-16 18:07:37 +00:00
|
|
|
static void Init();
|
|
|
|
|
2015-01-18 19:28:05 +00:00
|
|
|
|
2014-12-16 18:07:37 +00:00
|
|
|
private:
|
|
|
|
|
|
|
|
struct Entry
|
|
|
|
{
|
|
|
|
Entry(const std::string &p, size_t h) :
|
|
|
|
path(p), hash(h)
|
|
|
|
{}
|
|
|
|
|
|
|
|
Entry(std::string &&p, size_t h) :
|
|
|
|
path(p), hash(h)
|
|
|
|
{}
|
|
|
|
|
|
|
|
std::string path;
|
|
|
|
size_t hash = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
static std::deque<Entry> _pathQueue;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|