mirror of
https://github.com/ksherlock/mpw.git
synced 2024-11-23 22:30:51 +00:00
46 lines
736 B
C++
46 lines
736 B
C++
#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);
|
|
|
|
static int32_t IDForCWD();
|
|
|
|
static void Init();
|
|
|
|
|
|
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
|