22 #ifndef Hypertable_Lib_NameIdMapper_h
23 #define Hypertable_Lib_NameIdMapper_h
58 bool name_to_id(
const std::string &name, std::string &
id,
bool *is_namespacep=0);
66 bool id_to_name(
const std::string &
id, std::string &name,
bool *is_namespacep=0);
74 void id_to_sublisting(
const std::string &
id,
bool include_sub_entries, std::vector<NamespaceListing> &listing);
82 void add_mapping(
const std::string &name, std::string &
id,
int flags=0,
bool ignore_exists=
false);
103 void rename(
const std::string &old_name,
const std::string &new_name);
105 void add_entry(
const std::string &names_parent,
const std::string &names_entry,
106 std::vector<uint64_t> &ids,
bool is_namespace);
109 bool do_mapping(
const std::string &input,
bool id_in, std::string &output,
bool *is_namespacep);
110 static void get_namespace_listing(
const std::vector<Hyperspace::DirEntryAttr> &dir_listing, std::vector<NamespaceListing> &listing);
125 #endif // Hypertable_Lib_NameIdMapper_h
bool id_to_name(const std::string &id, std::string &name, bool *is_namespacep=0)
void add_entry(const std::string &names_parent, const std::string &names_entry, std::vector< uint64_t > &ids, bool is_namespace)
void id_to_sublisting(const std::string &id, bool include_sub_entries, std::vector< NamespaceListing > &listing)
bool do_mapping(const std::string &input, bool id_in, std::string &output, bool *is_namespacep)
void drop_mapping(const std::string &name)
Drops a mapping.
std::string m_toplevel_dir
std::shared_ptr< Session > SessionPtr
bool exists_mapping(const std::string &name, bool *is_namespace)
void add_mapping(const std::string &name, std::string &id, int flags=0, bool ignore_exists=false)
Adds a new mapping.
Compatibility Macros for C/C++.
Hyperspace::SessionPtr m_hyperspace
void rename(const std::string &old_name, const std::string &new_name)
Rename one entity, it doesn't recursively rename all entities under the path specified by old_name...
static void get_namespace_listing(const std::vector< Hyperspace::DirEntryAttr > &dir_listing, std::vector< NamespaceListing > &listing)
A String class based on std::string.
bool name_to_id(const std::string &name, std::string &id, bool *is_namespacep=0)
size_t m_prefix_components
Easy mapping between a Table/Namespace name string to ids and vice versa.
std::shared_ptr< NameIdMapper > NameIdMapperPtr
Smart pointer to NameIdMapper.
NameIdMapper(Hyperspace::SessionPtr &hyperspace, const std::string &toplevel_dir)