#ifndef LIBRARIES_NACL_IO_PATH_H_
#define LIBRARIES_NACL_IO_PATH_H_
#include <string>
#include <vector>
#include "sdk_util/macros.h"
namespace nacl_io {
typedef std::vector<std::string> StringArray_t;
class Path {
public:
Path();
Path(const Path& path);
explicit Path(const std::string& path);
~Path();
bool IsAbsolute() const;
const std::string& Part(size_t index) const;
size_t Size() const;
bool Top() const;
Path& Append(const std::string& path);
Path& Prepend(const std::string& path);
Path& Set(const std::string& path);
Path Parent() const;
std::string Basename() const;
std::string Join() const;
std::string Range(size_t start, size_t end) const;
StringArray_t Split() const;
static StringArray_t Normalize(const StringArray_t& paths);
static std::string Join(const StringArray_t& paths);
static std::string Range(const StringArray_t& paths, size_t start,
size_t end);
static StringArray_t Split(const std::string& paths);
Path& operator=(const Path& p);
Path& operator=(const std::string& str);
bool operator==(const Path& other) { return Split() == other.Split(); }
bool operator!=(const Path& other) { return !operator==(other); }
private:
StringArray_t paths_;
};
}
#endif