mirror of
https://github.com/anope/anope.git
synced 2026-06-12 17:24:49 +02:00
Pascalize some typedefs in Configuration::Block.
This commit is contained in:
+5
-5
@@ -26,13 +26,13 @@ namespace Configuration
|
|||||||
friend class Configuration::Conf;
|
friend class Configuration::Conf;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Anope::map<Anope::string> item_map;
|
typedef Anope::map<Anope::string> ItemMap;
|
||||||
typedef Anope::multimap<Block> block_map;
|
typedef Anope::multimap<Block> BlockMap;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Anope::string name;
|
Anope::string name;
|
||||||
item_map items;
|
ItemMap items;
|
||||||
block_map blocks;
|
BlockMap blocks;
|
||||||
int linenum;
|
int linenum;
|
||||||
|
|
||||||
/* Represents a missing tag. */
|
/* Represents a missing tag. */
|
||||||
@@ -51,7 +51,7 @@ namespace Configuration
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Set(const Anope::string &tag, const Anope::string &value);
|
bool Set(const Anope::string &tag, const Anope::string &value);
|
||||||
const item_map &GetItems() const;
|
const ItemMap &GetItems() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
template<> CoreExport const Anope::string Block::Get(const Anope::string &tag, const Anope::string &def) const;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
for (unsigned i = 0; !show_blocks[i].empty(); ++i)
|
for (unsigned i = 0; !show_blocks[i].empty(); ++i)
|
||||||
{
|
{
|
||||||
const auto &block = Config->GetBlock(show_blocks[i]);
|
const auto &block = Config->GetBlock(show_blocks[i]);
|
||||||
const Configuration::Block::item_map &items = block.GetItems();
|
const auto &items = block.GetItems();
|
||||||
|
|
||||||
ListFormatter lflist(source.GetAccount());
|
ListFormatter lflist(source.GetAccount());
|
||||||
lflist.AddColumn(_("Name")).AddColumn(_("Value"));
|
lflist.AddColumn(_("Name")).AddColumn(_("Value"));
|
||||||
@@ -87,7 +87,7 @@ public:
|
|||||||
for (int i = 0; i < Config->CountBlock("module"); ++i)
|
for (int i = 0; i < Config->CountBlock("module"); ++i)
|
||||||
{
|
{
|
||||||
const auto &block = Config->GetBlock("module", i);
|
const auto &block = Config->GetBlock("module", i);
|
||||||
const Configuration::Block::item_map &items = block.GetItems();
|
const auto &items = block.GetItems();
|
||||||
|
|
||||||
if (items.size() <= 1)
|
if (items.size() <= 1)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
+5
-5
@@ -45,7 +45,7 @@ int Configuration::Block::CountBlock(const Anope::string &bname) const
|
|||||||
|
|
||||||
const Configuration::Block &Configuration::Block::GetBlock(const Anope::string &bname, int num) const
|
const Configuration::Block &Configuration::Block::GetBlock(const Anope::string &bname, int num) const
|
||||||
{
|
{
|
||||||
std::pair<block_map::const_iterator, block_map::const_iterator> it = blocks.equal_range(bname);
|
auto it = blocks.equal_range(bname);
|
||||||
|
|
||||||
for (int i = 0; it.first != it.second; ++it.first, ++i)
|
for (int i = 0; it.first != it.second; ++it.first, ++i)
|
||||||
if (i == num)
|
if (i == num)
|
||||||
@@ -55,7 +55,7 @@ const Configuration::Block &Configuration::Block::GetBlock(const Anope::string &
|
|||||||
|
|
||||||
Configuration::Block *Configuration::Block::GetMutableBlock(const Anope::string &bname, int num)
|
Configuration::Block *Configuration::Block::GetMutableBlock(const Anope::string &bname, int num)
|
||||||
{
|
{
|
||||||
std::pair<block_map::iterator, block_map::iterator> it = blocks.equal_range(bname);
|
auto it = blocks.equal_range(bname);
|
||||||
|
|
||||||
for (int i = 0; it.first != it.second; ++it.first, ++i)
|
for (int i = 0; it.first != it.second; ++it.first, ++i)
|
||||||
if (i == num)
|
if (i == num)
|
||||||
@@ -69,7 +69,7 @@ bool Configuration::Block::Set(const Anope::string &tag, const Anope::string &va
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Configuration::Block::item_map &Configuration::Block::GetItems() const
|
const Configuration::Block::ItemMap &Configuration::Block::GetItems() const
|
||||||
{
|
{
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
@@ -655,7 +655,7 @@ Configuration::Block &Configuration::Conf::GetModule(const Anope::string &mname)
|
|||||||
auto *&block = modules[mname];
|
auto *&block = modules[mname];
|
||||||
|
|
||||||
/* Search for the block */
|
/* Search for the block */
|
||||||
for (std::pair<block_map::iterator, block_map::iterator> iters = blocks.equal_range("module"); iters.first != iters.second; ++iters.first)
|
for (auto iters = blocks.equal_range("module"); iters.first != iters.second; ++iters.first)
|
||||||
{
|
{
|
||||||
auto &b = iters.first->second;
|
auto &b = iters.first->second;
|
||||||
|
|
||||||
@@ -688,7 +688,7 @@ const Configuration::Block &Configuration::Conf::GetCommand(CommandSource &sourc
|
|||||||
{
|
{
|
||||||
const Anope::string &block_name = source.c ? "fantasy" : "command";
|
const Anope::string &block_name = source.c ? "fantasy" : "command";
|
||||||
|
|
||||||
for (std::pair<block_map::iterator, block_map::iterator> iters = blocks.equal_range(block_name); iters.first != iters.second; ++iters.first)
|
for (auto iters = blocks.equal_range(block_name); iters.first != iters.second; ++iters.first)
|
||||||
{
|
{
|
||||||
auto &b = iters.first->second;
|
auto &b = iters.first->second;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user