Replace typedef with using

This commit is contained in:
Martchus 2018-07-11 13:19:43 +02:00
parent d434c4e299
commit af4b43ff79
19 changed files with 44 additions and 43 deletions

View File

@ -27,7 +27,7 @@ constexpr auto aacSbrM = 49;
constexpr auto aacSbrMaxLe = 5;
constexpr auto aacSbrMaxNtsrhfg = 40;
typedef const sbyte (*SbrHuffTab)[2];
using SbrHuffTab = const sbyte (*)[2];
namespace AacSyntaxElementTypes {
enum KnownTypes : byte {

View File

@ -15,12 +15,12 @@ namespace TagParser {
/*!
* \brief Type used to store unsigned integer values using golomb coding.
*/
typedef uint32 ugolomb;
using ugolomb = uint32;
/*!
* \brief Type used to store signed integer values using golomb coding.
*/
typedef int32 sgolomb;
using sgolomb = int32;
struct TAG_PARSER_EXPORT TimingInfo {
constexpr TimingInfo();

View File

@ -32,9 +32,10 @@ template <class ImplementationType> class FieldMapBasedTag : public Tag {
friend class FieldMapBasedTagTraits<ImplementationType>;
public:
typedef typename FieldMapBasedTagTraits<ImplementationType>::FieldType FieldType;
typedef typename FieldMapBasedTagTraits<ImplementationType>::FieldType::IdentifierType IdentifierType;
typedef typename FieldMapBasedTagTraits<ImplementationType>::Compare Compare;
using FieldType = typename FieldMapBasedTagTraits<ImplementationType>::FieldType;
using IdentifierType = typename FieldMapBasedTagTraits<ImplementationType>::FieldType::IdentifierType;
using Compare = typename FieldMapBasedTagTraits<ImplementationType>::Compare;
using FieldMapBasedTagBase = FieldMapBasedTag<ImplementationType>;
FieldMapBasedTag();

View File

@ -49,10 +49,10 @@ public:
void removeAllTracks() override;
void reset() override;
typedef FileInfoType ContainerFileInfoType;
typedef TagType ContainerTagType;
typedef TrackType ContainerTrackType;
typedef ElementType ContainerElementType;
using ContainerFileInfoType = FileInfoType;
using ContainerTagType = TagType;
using ContainerTrackType = TrackType;
using ContainerElementType = ElementType;
protected:
std::unique_ptr<ElementType> m_firstElement;

View File

@ -51,17 +51,17 @@ public:
/*!
* \brief Specifies the type of the corresponding container.
*/
typedef typename FileElementTraits<ImplementationType>::ContainerType ContainerType;
using ContainerType = typename FileElementTraits<ImplementationType>::ContainerType;
/*!
* \brief Specifies the type used to store identifiers.
*/
typedef typename FileElementTraits<ImplementationType>::IdentifierType IdentifierType;
using IdentifierType = typename FileElementTraits<ImplementationType>::IdentifierType;
/*!
* \brief Specifies the type used to store data sizes.
*/
typedef typename FileElementTraits<ImplementationType>::DataSizeType DataSizeType;
using DataSizeType = typename FileElementTraits<ImplementationType>::DataSizeType;
GenericFileElement(ContainerType &container, uint64 startOffset);
GenericFileElement(ImplementationType &parent, uint64 startOffset);

View File

@ -31,8 +31,8 @@ template <class ImplementationType> class TAG_PARSER_EXPORT TagField {
friend class TagFieldTraits<ImplementationType>;
public:
typedef typename TagFieldTraits<ImplementationType>::IdentifierType IdentifierType;
typedef typename TagFieldTraits<ImplementationType>::TypeInfoType TypeInfoType;
using IdentifierType = typename TagFieldTraits<ImplementationType>::IdentifierType;
using TypeInfoType = typename TagFieldTraits<ImplementationType>::TypeInfoType;
TagField();
TagField(const IdentifierType &id, const TagValue &value);

View File

@ -79,8 +79,8 @@ inline uint32 Id3v2FrameMaker::requiredSize() const
*/
template <> class TAG_PARSER_EXPORT TagFieldTraits<Id3v2Frame> {
public:
typedef uint32 IdentifierType;
typedef byte TypeInfoType;
using IdentifierType = uint32;
using TypeInfoType = byte;
};
class TAG_PARSER_EXPORT Id3v2Frame : public TagField<Id3v2Frame> {

View File

@ -54,8 +54,8 @@ inline uint64 Id3v2TagMaker::requiredSize() const
*/
template <> class TAG_PARSER_EXPORT FieldMapBasedTagTraits<Id3v2Tag> {
public:
typedef Id3v2Frame FieldType;
typedef FrameComparer Compare;
using FieldType = Id3v2Frame;
using Compare = FrameComparer;
};
class TAG_PARSER_EXPORT Id3v2Tag : public FieldMapBasedTag<Id3v2Tag> {

View File

@ -23,9 +23,9 @@ class MatroskaContainer;
*/
template <> class TAG_PARSER_EXPORT FileElementTraits<EbmlElement> {
public:
typedef MatroskaContainer ContainerType;
typedef uint32 IdentifierType;
typedef uint64 DataSizeType;
using ContainerType = MatroskaContainer;
using IdentifierType = uint32;
using DataSizeType = uint64;
};
class TAG_PARSER_EXPORT EbmlElement : public GenericFileElement<EbmlElement> {

View File

@ -280,7 +280,7 @@ void MatroskaTagMaker::make(ostream &stream) const
stream.write(t.levelName().c_str(), t.levelName().size());
}
// write UIDs
typedef pair<uint16, vector<uint64>> p;
using p = pair<uint16, vector<uint64>>;
for (const auto &pair : initializer_list<p>{ p(MatroskaIds::TagTrackUID, t.tracks()), p(MatroskaIds::TagEditionUID, t.editions()),
p(MatroskaIds::TagChapterUID, t.chapters()), p(MatroskaIds::TagAttachmentUID, t.attachments()) }) {
if (!pair.second.empty()) {

View File

@ -51,8 +51,8 @@ inline uint64 MatroskaTagMaker::requiredSize() const
*/
template <> class TAG_PARSER_EXPORT FieldMapBasedTagTraits<MatroskaTag> {
public:
typedef MatroskaTagField FieldType;
typedef std::less<typename FieldType::IdentifierType> Compare;
using FieldType = MatroskaTagField;
using Compare = std::less<typename FieldType::IdentifierType>;
};
class TAG_PARSER_EXPORT MatroskaTag : public FieldMapBasedTag<MatroskaTag> {

View File

@ -14,8 +14,8 @@ class Diagnostics;
*/
template <> class TAG_PARSER_EXPORT TagFieldTraits<MatroskaTagField> {
public:
typedef std::string IdentifierType;
typedef std::string TypeInfoType;
using IdentifierType = std::string;
using TypeInfoType = std::string;
static bool supportsNestedFields();
};

View File

@ -22,9 +22,9 @@ class Mp4Container;
*/
template <> class TAG_PARSER_EXPORT FileElementTraits<Mp4Atom> {
public:
typedef Mp4Container ContainerType;
typedef uint32 IdentifierType;
typedef uint64 DataSizeType;
using ContainerType = Mp4Container;
using IdentifierType = uint32;
using DataSizeType = uint64;
/*!
* \brief Returns the minimal atom size which is 8 byte.

View File

@ -90,8 +90,8 @@ inline uint64 Mp4TagMaker::requiredSize() const
*/
template <> class TAG_PARSER_EXPORT FieldMapBasedTagTraits<Mp4Tag> {
public:
typedef Mp4TagField FieldType;
typedef std::less<typename FieldType::IdentifierType> Compare;
using FieldType = Mp4TagField;
using Compare = std::less<typename FieldType::IdentifierType>;
};
class TAG_PARSER_EXPORT Mp4Tag : public FieldMapBasedTag<Mp4Tag> {

View File

@ -53,8 +53,8 @@ class Diagnostics;
*/
template <> class TAG_PARSER_EXPORT TagFieldTraits<Mp4TagField> {
public:
typedef uint32 IdentifierType;
typedef uint32 TypeInfoType;
using IdentifierType = uint32;
using TypeInfoType = uint32;
};
class Mp4Atom;

View File

@ -15,9 +15,9 @@ class Mpeg4Descriptor;
*/
template <> class TAG_PARSER_EXPORT FileElementTraits<Mpeg4Descriptor> {
public:
typedef Mp4Container ContainerType;
typedef byte IdentifierType;
typedef uint32 DataSizeType;
using ContainerType = Mp4Container;
using IdentifierType = byte;
using DataSizeType = uint32;
/*!
* \brief Returns the minimal descriptor size which is 2 byte.

View File

@ -20,8 +20,8 @@ TAG_PARSER_EXPORT const char *tagTargetLevelName(TagTargetLevel tagTargetLevel);
class TAG_PARSER_EXPORT TagTarget {
public:
typedef uint64 IdType;
typedef std::vector<IdType> IdContainerType;
using IdType = uint64;
using IdContainerType = std::vector<IdType>;
TagTarget(uint64 level = 0, IdContainerType tracks = IdContainerType(), IdContainerType chapters = IdContainerType(),
IdContainerType editions = IdContainerType(), IdContainerType attachments = IdContainerType());

View File

@ -18,8 +18,8 @@ class Diagnostics;
*/
template <> class TAG_PARSER_EXPORT FieldMapBasedTagTraits<VorbisComment> {
public:
typedef VorbisCommentField FieldType;
typedef CaseInsensitiveStringComparer Compare;
using FieldType = VorbisCommentField;
using Compare = CaseInsensitiveStringComparer;
};
class TAG_PARSER_EXPORT VorbisComment : public FieldMapBasedTag<VorbisComment> {

View File

@ -38,8 +38,8 @@ class Diagnostics;
*/
template <> class TAG_PARSER_EXPORT TagFieldTraits<VorbisCommentField> {
public:
typedef std::string IdentifierType;
typedef uint32 TypeInfoType;
using IdentifierType = std::string;
using TypeInfoType = uint32;
};
class OggIterator;