Rename id_map to IdMap

This commit is contained in:
Maxime Coste 2014-12-23 22:51:00 +00:00
parent fb611e2f62
commit b0fef1a962
8 changed files with 11 additions and 11 deletions

View File

@ -67,7 +67,7 @@ std::unique_ptr<SimpleHighlighter<T>> make_simple_highlighter(T func)
using HighlighterParameters = memoryview<String>;
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
struct HighlighterRegistry : id_map<HighlighterFactory>,
struct HighlighterRegistry : IdMap<HighlighterFactory>,
Singleton<HighlighterRegistry>
{};

View File

@ -28,7 +28,7 @@ public:
Completions complete_child(StringView path, ByteCount cursor_pos, bool group) const override;
private:
using HighlighterMap = id_map<std::unique_ptr<Highlighter>>;
using HighlighterMap = IdMap<std::unique_ptr<Highlighter>>;
HighlighterMap m_highlighters;
};

View File

@ -958,7 +958,7 @@ public:
return offset_pos(hl.complete_child(path.substr(offset), cursor_pos - offset, group), offset);
}
auto container = transformed(m_groups, id_map<HighlighterGroup>::get_id);
auto container = transformed(m_groups, IdMap<HighlighterGroup>::get_id);
return { 0, 0, complete(path, cursor_pos, container) };
}
@ -1005,7 +1005,7 @@ public:
private:
const NamedRegionDescList m_regions;
const String m_default_group;
id_map<HighlighterGroup> m_groups;
IdMap<HighlighterGroup> m_groups;
struct Region
{

View File

@ -27,7 +27,7 @@ CandidateList HookManager::complete_hook_group(StringView prefix, ByteCount pos_
CandidateList res;
for (auto& list : m_hook)
{
auto container = transformed(list.second, id_map<HookFunc>::get_id);
auto container = transformed(list.second, IdMap<HookFunc>::get_id);
for (auto& c : complete(prefix, pos_in_token, container))
{
if (!contains(res, c))

View File

@ -29,7 +29,7 @@ private:
friend class Scope;
HookManager* m_parent;
UnorderedMap<String, id_map<HookFunc>> m_hook;
UnorderedMap<String, IdMap<HookFunc>> m_hook;
};
}

View File

@ -10,7 +10,7 @@ namespace Kakoune
{
template<typename Value>
class id_map
class IdMap
{
public:
using value_type = std::pair<String, Value>;
@ -18,8 +18,8 @@ public:
using iterator = typename container_type::iterator;
using const_iterator = typename container_type::const_iterator;
id_map() = default;
id_map(std::initializer_list<value_type> val) : m_content{val} {}
IdMap() = default;
IdMap(std::initializer_list<value_type> val) : m_content{val} {}
void append(const value_type& value)
{

View File

@ -40,7 +40,7 @@ struct SwitchDesc
String description;
};
using SwitchMap = id_map<SwitchDesc>;
using SwitchMap = IdMap<SwitchDesc>;
String generate_switches_doc(const SwitchMap& opts);

View File

@ -61,7 +61,7 @@ Register& RegisterManager::operator[](StringView reg)
if (reg.length() == 1)
return (*this)[reg[0]];
static const id_map<Codepoint> reg_names = {
static const IdMap<Codepoint> reg_names = {
{ "slash", '/' },
{ "dquote", '"' },
{ "pipe", '|' }