Style changes, replace typedefs with usings

This commit is contained in:
Maxime Coste 2014-01-09 19:50:01 +00:00
parent 560b4ab0b5
commit e6884f989c
12 changed files with 30 additions and 32 deletions

View File

@ -6,7 +6,6 @@
#include "option_manager.hh"
#include "keymap_manager.hh"
#include "string.hh"
#include "units.hh"
#include <vector>
#include <list>
@ -30,11 +29,11 @@ struct BufferCoord : LineAndColumn<BufferCoord, LineCount, ByteCount>
class BufferIterator
{
public:
typedef char value_type;
typedef size_t difference_type;
typedef const value_type* pointer;
typedef const value_type& reference;
typedef std::random_access_iterator_tag iterator_category;
using value_type = char;
using difference_type = size_t;
using pointer = const value_type*;
using reference = const value_type&;
using iterator_category = std::random_access_iterator_tag;
BufferIterator() : m_buffer(nullptr) {}
BufferIterator(const Buffer& buffer, BufferCoord coord);
@ -202,7 +201,7 @@ private:
Flags m_flags;
struct Modification;
typedef std::vector<Modification> UndoGroup;
using UndoGroup = std::vector<Modification>;
friend class UndoGroupOptimizer;
std::vector<UndoGroup> m_history;

View File

@ -1,17 +1,18 @@
#ifndef completion_hh_INCLUDED
#define completion_hh_INCLUDED
#include "string.hh"
#include <vector>
#include <functional>
#include "units.hh"
namespace Kakoune
{
class Context;
typedef std::vector<String> CandidateList;
class String;
using CandidateList = std::vector<String>;
struct Completions
{

View File

@ -18,7 +18,7 @@ struct DisplayCoord : LineAndColumn<DisplayCoord, LineCount, CharCount>
: LineAndColumn(line, column) {}
};
typedef char Attribute;
using Attribute = char;
enum Attributes
{

View File

@ -20,12 +20,10 @@ class Context;
// color, adding information text (line numbering for example) or replacing
// buffer content (folding for example)
typedef std::function<void (const Context& context, DisplayBuffer& display_buffer)> HighlighterFunc;
typedef std::pair<String, HighlighterFunc> HighlighterAndId;
typedef memoryview<String> HighlighterParameters;
using HighlighterFunc = std::function<void (const Context& context, DisplayBuffer& display_buffer)>;
using HighlighterAndId = std::pair<String, HighlighterFunc>;
using HighlighterParameters = memoryview<String>;
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
using HighlighterGroup = FunctionGroup<const Context&, DisplayBuffer&>;
struct HighlighterRegistry : FunctionRegistry<HighlighterFactory>,

View File

@ -10,7 +10,7 @@ namespace Kakoune
{
class Context;
typedef std::function<void (const String&, Context&)> HookFunc;
using HookFunc = std::function<void (const String&, Context&)>;
class HookManager
{

View File

@ -13,10 +13,10 @@ template<typename Value>
class id_map
{
public:
typedef std::pair<String, Value> value_type;
typedef std::vector<value_type> container_type;
typedef typename container_type::iterator iterator;
typedef typename container_type::const_iterator const_iterator;
using value_type = std::pair<String, Value>;
using container_type = std::vector<value_type>;
using iterator = typename container_type::iterator;
using const_iterator = typename container_type::const_iterator;
void append(const value_type& value)
{

View File

@ -64,7 +64,7 @@ struct Key
{ return modifiers != other.modifiers or key != other.key; }
};
typedef std::vector<Key> KeyList;
using KeyList = std::vector<Key>;
KeyList parse_keys(const String& str);
String key_to_str(Key key);

View File

@ -74,11 +74,11 @@ struct ParametersParser
struct iterator
{
public:
typedef String value_type;
typedef const value_type* pointer;
typedef const value_type& reference;
typedef size_t difference_type;
typedef std::forward_iterator_tag iterator_category;
using value_type = String;
using pointer = const value_type*;
using reference = const value_type&;
using difference_type = size_t;
using iterator_category = std::forward_iterator_tag;
iterator(const ParametersParser& parser, size_t index)
: m_parser(parser), m_index(index) {}

View File

@ -11,7 +11,7 @@
namespace Kakoune
{
typedef std::function<std::vector<String> (const Context&)> RegisterRetriever;
using RegisterRetriever = std::function<std::vector<String> (const Context&)>;
class RegisterManager : public Singleton<RegisterManager>
{

View File

@ -56,7 +56,7 @@ inline Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
return {first.base().coord(), last.base().coord()};
}
typedef boost::regex_iterator<BufferIterator> RegexIterator;
using RegexIterator = boost::regex_iterator<BufferIterator>;
template<WordType word_type>
Selection select_to_next_word(const Buffer& buffer, const Selection& selection)

View File

@ -10,8 +10,8 @@ namespace Kakoune
{
struct Context;
typedef std::function<String (const String& name, const Context&)> EnvVarRetriever;
typedef std::unordered_map<String, String> EnvVarMap;
using EnvVarRetriever = std::function<String (const String& name, const Context&)>;
using EnvVarMap = std::unordered_map<String, String>;
class ShellManager : public Singleton<ShellManager>
{

View File

@ -11,7 +11,7 @@
namespace Kakoune
{
typedef boost::regex Regex;
using Regex = boost::regex;
class String : public std::string
{