mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2026-04-07 12:18:40 +00:00
chore: replace all usages of removed ClassUtils macros
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "Obj/Gdt/GdtEntry.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <istream>
|
||||
#include <string>
|
||||
@@ -16,14 +16,14 @@ class InfoString
|
||||
std::vector<std::string> m_keys_by_insertion;
|
||||
|
||||
public:
|
||||
_NODISCARD bool HasKey(const std::string& key) const;
|
||||
_NODISCARD const std::string& GetValueForKey(const std::string& key) const;
|
||||
[[nodiscard]] bool HasKey(const std::string& key) const;
|
||||
[[nodiscard]] const std::string& GetValueForKey(const std::string& key) const;
|
||||
const std::string& GetValueForKey(const std::string& key, bool* foundValue) const;
|
||||
void SetValueForKey(const std::string& key, std::string value);
|
||||
void RemoveKey(const std::string& key);
|
||||
|
||||
_NODISCARD std::string ToString() const;
|
||||
_NODISCARD std::string ToString(const std::string& prefix) const;
|
||||
[[nodiscard]] std::string ToString() const;
|
||||
[[nodiscard]] std::string ToString(const std::string& prefix) const;
|
||||
void ToGdtProperties(const std::string& prefix, GdtEntry& gdtEntry) const;
|
||||
|
||||
bool FromStream(std::istream& stream);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "SearchPathSearchOptions.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "SearchPathFilesystem.h"
|
||||
|
||||
#include "Utils/Logging/Log.h"
|
||||
#include "Utils/ObjFileStream.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <filesystem>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "FlacDecoder.h"
|
||||
|
||||
#include "Utils/Alignment.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Utils/Endianness.h"
|
||||
#include "Utils/FileUtils.h"
|
||||
#include "Utils/Logging/Log.h"
|
||||
@@ -42,7 +41,7 @@ namespace
|
||||
{
|
||||
}
|
||||
|
||||
_NODISCARD char const* what() const noexcept override
|
||||
[[nodiscard]] char const* what() const noexcept override
|
||||
{
|
||||
return m_message.c_str();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "CommonStructuredDataEnum.h"
|
||||
#include "CommonStructuredDataStruct.h"
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
@@ -23,5 +22,5 @@ public:
|
||||
CommonStructuredDataDef();
|
||||
explicit CommonStructuredDataDef(int version);
|
||||
|
||||
_NODISCARD uint32_t CalculateChecksum() const;
|
||||
[[nodiscard]] uint32_t CalculateChecksum() const;
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#pragma once
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
@@ -25,8 +24,8 @@ struct CommonStructuredDataEnum
|
||||
explicit CommonStructuredDataEnum(std::string name);
|
||||
CommonStructuredDataEnum(std::string name, int reservedEntryCount);
|
||||
|
||||
_NODISCARD size_t ElementCount() const;
|
||||
_NODISCARD uint32_t CalculateChecksum(uint32_t initialValue) const;
|
||||
[[nodiscard]] size_t ElementCount() const;
|
||||
[[nodiscard]] uint32_t CalculateChecksum(uint32_t initialValue) const;
|
||||
|
||||
void SortEntriesByOffset();
|
||||
void SortEntriesByName();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
enum class CommonStructuredDataTypeCategory
|
||||
@@ -36,8 +34,8 @@ struct CommonStructuredDataType
|
||||
explicit CommonStructuredDataType(CommonStructuredDataTypeCategory category);
|
||||
CommonStructuredDataType(CommonStructuredDataTypeCategory category, size_t extraInfo);
|
||||
|
||||
_NODISCARD size_t GetAlignmentInBits() const;
|
||||
_NODISCARD size_t GetSizeInBits(const CommonStructuredDataDef& def) const;
|
||||
[[nodiscard]] size_t GetAlignmentInBits() const;
|
||||
[[nodiscard]] size_t GetSizeInBits(const CommonStructuredDataDef& def) const;
|
||||
|
||||
friend bool operator<(const CommonStructuredDataType& lhs, const CommonStructuredDataType& rhs);
|
||||
friend bool operator<=(const CommonStructuredDataType& lhs, const CommonStructuredDataType& rhs);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
@@ -41,7 +39,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
_NODISCARD size_t GetDistinctPositionByInputPosition(const size_t inputPosition) const
|
||||
[[nodiscard]] size_t GetDistinctPositionByInputPosition(const size_t inputPosition) const
|
||||
{
|
||||
if (inputPosition >= m_distinct_position_by_input_position.size())
|
||||
return 0;
|
||||
@@ -49,7 +47,7 @@ public:
|
||||
return m_distinct_position_by_input_position[inputPosition];
|
||||
}
|
||||
|
||||
_NODISCARD T GetDistinctValueByInputPosition(const size_t inputPosition) const
|
||||
[[nodiscard]] T GetDistinctValueByInputPosition(const size_t inputPosition) const
|
||||
{
|
||||
if (inputPosition >= m_distinct_values.size())
|
||||
return T{};
|
||||
@@ -57,7 +55,7 @@ public:
|
||||
return m_distinct_values[inputPosition];
|
||||
}
|
||||
|
||||
_NODISCARD size_t GetInputPositionByDistinctPosition(const size_t distinctPosition) const
|
||||
[[nodiscard]] size_t GetInputPositionByDistinctPosition(const size_t distinctPosition) const
|
||||
{
|
||||
if (distinctPosition >= m_input_position_by_distinct_position.size())
|
||||
return 0;
|
||||
@@ -65,17 +63,17 @@ public:
|
||||
return m_input_position_by_distinct_position[distinctPosition];
|
||||
}
|
||||
|
||||
_NODISCARD const std::vector<T>& GetDistinctValues() const
|
||||
[[nodiscard]] const std::vector<T>& GetDistinctValues() const
|
||||
{
|
||||
return m_distinct_values;
|
||||
}
|
||||
|
||||
_NODISCARD size_t GetInputValueCount() const
|
||||
[[nodiscard]] size_t GetInputValueCount() const
|
||||
{
|
||||
return m_input_entry_index;
|
||||
}
|
||||
|
||||
_NODISCARD size_t GetDistinctValueCount() const
|
||||
[[nodiscard]] size_t GetDistinctValueCount() const
|
||||
{
|
||||
return m_distinct_entry_index;
|
||||
}
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
// ReSharper disable CppHidingFunction
|
||||
// ReSharper disable IdentifierTypo
|
||||
// ReSharper disable CppInconsistentNaming
|
||||
#pragma once
|
||||
|
||||
// #include <fstream>
|
||||
//
|
||||
// #include "ObjStream.h"
|
||||
//
|
||||
// template <class Elem, class Traits>
|
||||
// class basic_fobjbuf final : public basic_objbuf<Elem, Traits>, public std::basic_filebuf<Elem, Traits>
|
||||
// {
|
||||
// public:
|
||||
// using myfb = std::basic_filebuf<Elem, Traits>;
|
||||
//
|
||||
// explicit basic_fobjbuf(myfb* fb)
|
||||
// {
|
||||
// m_fb.swap(*fb);
|
||||
// }
|
||||
//
|
||||
// _NODISCARD bool is_open() const override
|
||||
// {
|
||||
// return m_fb.is_open();
|
||||
// }
|
||||
//
|
||||
// bool close() override
|
||||
// {
|
||||
// return m_fb.close();
|
||||
// }
|
||||
//
|
||||
// private:
|
||||
// myfb m_fb;
|
||||
// };
|
||||
//
|
||||
// template <class Elem, class Traits>
|
||||
// class basic_fobjstream final : public basic_objstream<Elem, Traits>
|
||||
// {
|
||||
// public:
|
||||
// using mybase = basic_objstream<Elem, Traits>;
|
||||
// using myfb = basic_fobjbuf<Elem, Traits>;
|
||||
//
|
||||
// using mybase::m_ob;
|
||||
//
|
||||
// explicit basic_fobjstream(std::fstream&& stream)
|
||||
// : mybase(std::make_unique<myfb>(std::move(*stream.rdbuf())))
|
||||
// {
|
||||
// // reinterpret_cast<myfb*>(m_ob.get())->swapp(*stream.rdbuf());
|
||||
// // reinterpret_cast<myfb*>(m_ob.get())->swap(*stream.rdbuf());
|
||||
// }
|
||||
//
|
||||
// basic_fobjstream(const basic_fobjstream& other) = delete;
|
||||
// basic_fobjstream(basic_fobjstream&& other) noexcept = default;
|
||||
// basic_fobjstream& operator=(const basic_fobjstream& other) = delete;
|
||||
// basic_fobjstream& operator=(basic_fobjstream&& other) noexcept = default;
|
||||
// };
|
||||
//
|
||||
// template <class Elem, class Traits>
|
||||
// class basic_ifobjstream final : public basic_iobjstream<Elem, Traits>
|
||||
// {
|
||||
// public:
|
||||
// using mybase = basic_iobjstream<Elem, Traits>;
|
||||
// using myfb = basic_fobjbuf<Elem, Traits>;
|
||||
//
|
||||
// using mybase::m_ob;
|
||||
//
|
||||
// explicit basic_ifobjstream(std::ifstream&& stream)
|
||||
// : mybase(std::make_unique<myfb>(std::move(*stream.rdbuf())))
|
||||
// {
|
||||
// // reinterpret_cast<myfb*>(m_ob.get())->swapp(*stream.rdbuf());
|
||||
// // m_ob->swapp(*stream.rdbuf());
|
||||
// }
|
||||
// ~basic_ifobjstream() = default;
|
||||
//
|
||||
// basic_ifobjstream(const basic_ifobjstream& other) = delete;
|
||||
// basic_ifobjstream(basic_ifobjstream&& other) noexcept = default;
|
||||
// basic_ifobjstream& operator=(const basic_ifobjstream& other) = delete;
|
||||
// basic_ifobjstream& operator=(basic_ifobjstream&& other) noexcept = default;
|
||||
// };
|
||||
//
|
||||
// template <class Elem, class Traits>
|
||||
// class basic_ofobjstream final : public basic_oobjstream<Elem, Traits>
|
||||
// {
|
||||
// public:
|
||||
// using mybase = basic_oobjstream<Elem, Traits>;
|
||||
// using myfb = basic_fobjbuf<Elem, Traits>;
|
||||
//
|
||||
// using mybase::m_ob;
|
||||
//
|
||||
// explicit basic_ofobjstream(std::ofstream file)
|
||||
// : mybase(std::make_unique<myfb>(file.rdbuf()))
|
||||
// {
|
||||
// }
|
||||
//
|
||||
// basic_ofobjstream(const basic_ofobjstream& other) = delete;
|
||||
// basic_ofobjstream(basic_ofobjstream&& other) noexcept = default;
|
||||
// basic_ofobjstream& operator=(const basic_ofobjstream& other) = delete;
|
||||
// basic_ofobjstream& operator=(basic_ofobjstream&& other) noexcept = default;
|
||||
// };
|
||||
//
|
||||
// using fobjbuf = basic_fobjbuf<char, std::char_traits<char>>;
|
||||
// using fobjstream = basic_fobjstream<char, std::char_traits<char>>;
|
||||
// using ifobjstream = basic_ifobjstream<char, std::char_traits<char>>;
|
||||
// using ofobjstream = basic_ofobjstream<char, std::char_traits<char>>;
|
||||
@@ -2,8 +2,6 @@
|
||||
// ReSharper disable IdentifierTypo
|
||||
#pragma once
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
|
||||
#include <cassert>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
@@ -12,7 +10,7 @@
|
||||
template<class Elem, class Traits> class basic_objbuf : public std::basic_streambuf<Elem, Traits>
|
||||
{
|
||||
public:
|
||||
_NODISCARD virtual bool is_open() const = 0;
|
||||
[[nodiscard]] virtual bool is_open() const = 0;
|
||||
virtual bool close() = 0;
|
||||
};
|
||||
|
||||
@@ -62,12 +60,12 @@ public:
|
||||
}
|
||||
|
||||
// ReSharper disable once CppHidingFunction
|
||||
_NODISCARD myob* rdbuf() const
|
||||
[[nodiscard]] myob* rdbuf() const
|
||||
{
|
||||
return const_cast<myob*>(m_ob.get());
|
||||
}
|
||||
|
||||
_NODISCARD bool is_open() const
|
||||
[[nodiscard]] bool is_open() const
|
||||
{
|
||||
return m_ob->is_open();
|
||||
}
|
||||
@@ -126,12 +124,12 @@ public:
|
||||
}
|
||||
|
||||
// ReSharper disable once CppHidingFunction
|
||||
_NODISCARD myob* rdbuf() const
|
||||
[[nodiscard]] myob* rdbuf() const
|
||||
{
|
||||
return const_cast<myob*>(m_ob.get());
|
||||
}
|
||||
|
||||
_NODISCARD bool is_open() const
|
||||
[[nodiscard]] bool is_open() const
|
||||
{
|
||||
return m_ob->is_open();
|
||||
}
|
||||
@@ -190,12 +188,12 @@ public:
|
||||
}
|
||||
|
||||
// ReSharper disable once CppHidingFunction
|
||||
_NODISCARD myob* rdbuf() const
|
||||
[[nodiscard]] myob* rdbuf() const
|
||||
{
|
||||
return const_cast<myob*>(m_ob.get());
|
||||
}
|
||||
|
||||
_NODISCARD bool is_open() const
|
||||
[[nodiscard]] bool is_open() const
|
||||
{
|
||||
return m_ob->is_open();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user