diff --git a/include/athena/DNAOp.hpp b/include/athena/DNAOp.hpp index a63e550..b9d1978 100644 --- a/include/athena/DNAOp.hpp +++ b/include/athena/DNAOp.hpp @@ -62,7 +62,7 @@ using __IsPODType = typename std::disjunction< std::is_convertible&, atVec2d&>, std::is_convertible&, atVec3d&>, std::is_convertible&, atVec4d&>>; template -inline constexpr bool __IsPODType_v = __IsPODType::value; +constexpr bool __IsPODType_v = __IsPODType::value; template using __CastPODType = typename std::conditional_t< @@ -78,32 +78,32 @@ using __CastPODType = typename std::conditional_t< std::remove_cv_t>>>>>>; template -inline uint16_t __Read16(IStreamReader& r) { +uint16_t __Read16(IStreamReader& r) { return DNAE == Endian::Big ? r.readUint16Big() : r.readUint16Little(); } template -inline void __Write16(IStreamWriter& w, uint16_t v) { +void __Write16(IStreamWriter& w, uint16_t v) { DNAE == Endian::Big ? w.writeUint16Big(v) : w.writeUint16Little(v); } template -inline uint32_t __Read32(IStreamReader& r) { +uint32_t __Read32(IStreamReader& r) { return DNAE == Endian::Big ? r.readUint32Big() : r.readUint32Little(); } template -inline void __Write32(IStreamWriter& w, uint32_t v) { +void __Write32(IStreamWriter& w, uint32_t v) { DNAE == Endian::Big ? w.writeUint32Big(v) : w.writeUint32Little(v); } template -inline uint64_t __Read64(IStreamReader& r) { +uint64_t __Read64(IStreamReader& r) { return DNAE == Endian::Big ? r.readUint64Big() : r.readUint64Little(); } template -inline void __Write64(IStreamWriter& w, uint64_t v) { +void __Write64(IStreamWriter& w, uint64_t v) { DNAE == Endian::Big ? w.writeUint64Big(v) : w.writeUint64Little(v); } @@ -795,77 +795,77 @@ __WRITE_YAML_S(atVec4f, Endian::Little) { w.writeVec4f(id.name, var); } __WRITE_YAML_S(atVec4d, Endian::Little) { w.writeVec4d(id.name, var); } template -inline void __Do(const PropId& id, T& var, typename Op::StreamT& s) { +void __Do(const PropId& id, T& var, typename Op::StreamT& s) { Op::template Do(id, var, s); } template -inline void __DoSize(const PropId& id, T& var, typename Op::StreamT& s) { +void __DoSize(const PropId& id, T& var, typename Op::StreamT& s) { Op::template DoSize(id, var, s); } template -inline void __Do(const PropId& id, std::vector& vector, const S& count, typename Op::StreamT& s) { +void __Do(const PropId& id, std::vector& vector, const S& count, typename Op::StreamT& s) { Op::template Do(id, vector, count, s); } template -inline void __Do(const PropId& id, std::unique_ptr& buf, size_t count, typename Op::StreamT& s) { +void __Do(const PropId& id, std::unique_ptr& buf, size_t count, typename Op::StreamT& s) { Op::Do(id, buf, count, s); } template -inline void __Do(const PropId& id, std::string& str, atInt32 count, typename Op::StreamT& s) { +void __Do(const PropId& id, std::string& str, atInt32 count, typename Op::StreamT& s) { Op::Do(id, str, count, s); } template -inline void __Do(const PropId& id, std::wstring& str, atInt32 count, typename Op::StreamT& s) { +void __Do(const PropId& id, std::wstring& str, atInt32 count, typename Op::StreamT& s) { Op::template Do(id, str, count, s); } template -inline void __DoSeek(atInt64 delta, athena::SeekOrigin whence, typename Op::StreamT& s) { +void __DoSeek(atInt64 delta, athena::SeekOrigin whence, typename Op::StreamT& s) { Op::DoSeek(delta, whence, s); } template -inline void __DoAlign(atInt64 amount, typename Op::StreamT& s) { +void __DoAlign(atInt64 amount, typename Op::StreamT& s) { Op::DoAlign(amount, s); } template -inline void __Read(T& obj, athena::io::IStreamReader& r) { +void __Read(T& obj, athena::io::IStreamReader& r) { __Do, T, T::DNAEndian>({}, obj, r); } template -inline void __Write(const T& obj, athena::io::IStreamWriter& w) { +void __Write(const T& obj, athena::io::IStreamWriter& w) { __Do, T, T::DNAEndian>({}, const_cast(obj), w); } template -inline void __BinarySize(const T& obj, size_t& s) { +void __BinarySize(const T& obj, size_t& s) { __Do, T, T::DNAEndian>({}, const_cast(obj), s); } template -inline void __PropCount(const T& obj, size_t& s) { +void __PropCount(const T& obj, size_t& s) { const_cast(obj).template Enumerate>(s); } template -inline void __ReadYaml(T& obj, athena::io::YAMLDocReader& r) { +void __ReadYaml(T& obj, athena::io::YAMLDocReader& r) { obj.template Enumerate>(r); } template -inline void __WriteYaml(const T& obj, athena::io::YAMLDocWriter& w) { +void __WriteYaml(const T& obj, athena::io::YAMLDocWriter& w) { const_cast(obj).template Enumerate>(w); } template -inline void __ReadProp(T& obj, athena::io::IStreamReader& r) { +void __ReadProp(T& obj, athena::io::IStreamReader& r) { /* Read root 0xffffffff hash (hashed empty string) */ T::DNAEndian == Endian::Big ? r.readUint32Big() : r.readUint32Little(); atInt64 size = T::DNAEndian == Endian::Big ? r.readUint16Big() : r.readUint16Little(); @@ -877,17 +877,17 @@ inline void __ReadProp(T& obj, athena::io::IStreamReader& r) { } template -inline void __WriteProp(const T& obj, athena::io::IStreamWriter& w) { +void __WriteProp(const T& obj, athena::io::IStreamWriter& w) { __Do, T, T::DNAEndian>({}, const_cast(obj), w); } template -inline void __BinarySizeProp(const T& obj, size_t& s) { +void __BinarySizeProp(const T& obj, size_t& s) { __Do, T, T::DNAEndian>({}, const_cast(obj), s); } template -inline void __ReadProp64(T& obj, athena::io::IStreamReader& r) { +void __ReadProp64(T& obj, athena::io::IStreamReader& r) { /* Read root 0x0 hash (hashed empty string) */ T::DNAEndian == Endian::Big ? r.readUint64Big() : r.readUint64Little(); atInt64 size = T::DNAEndian == Endian::Big ? r.readUint16Big() : r.readUint16Little(); @@ -899,12 +899,12 @@ inline void __ReadProp64(T& obj, athena::io::IStreamReader& r) { } template -inline void __WriteProp64(const T& obj, athena::io::IStreamWriter& w) { +void __WriteProp64(const T& obj, athena::io::IStreamWriter& w) { __Do, T, T::DNAEndian>({}, const_cast(obj), w); } template -inline void __BinarySizeProp64(const T& obj, size_t& s) { +void __BinarySizeProp64(const T& obj, size_t& s) { __Do, T, T::DNAEndian>({}, const_cast(obj), s); } diff --git a/include/athena/DNAYaml.hpp b/include/athena/DNAYaml.hpp index 01d8dc7..61afad9 100644 --- a/include/athena/DNAYaml.hpp +++ b/include/athena/DNAYaml.hpp @@ -9,17 +9,17 @@ namespace athena::io { template -inline const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { +const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { return dna.DNATypeV(); } template -inline const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { +const char* __GetDNAName(const T& dna, typename std::enable_if_t>* = 0) { return dna.DNAType(); } template -inline std::string ToYAMLString(const T& dna) { +std::string ToYAMLString(const T& dna) { YAMLDocWriter docWriter(__GetDNAName(dna)); std::string res; @@ -35,7 +35,7 @@ inline std::string ToYAMLString(const T& dna) { } template -inline bool FromYAMLString(T& dna, std::string_view str) { +bool FromYAMLString(T& dna, std::string_view str) { YAMLStdStringViewReaderState reader(str); YAMLDocReader docReader; yaml_parser_set_input(docReader.getParser(), (yaml_read_handler_t*)YAMLStdStringReader, &reader); @@ -46,7 +46,7 @@ inline bool FromYAMLString(T& dna, std::string_view str) { } template -inline bool ValidateFromYAMLString(std::string_view str) { +bool ValidateFromYAMLString(std::string_view str) { YAMLStdStringViewReaderState reader(str); YAMLDocReader docReader; yaml_parser_set_input(docReader.getParser(), (yaml_read_handler_t*)YAMLStdStringReader, &reader); @@ -55,7 +55,7 @@ inline bool ValidateFromYAMLString(std::string_view str) { } template -inline bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout) { +bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout) { YAMLDocWriter docWriter(__GetDNAName(dna)); yaml_emitter_set_unicode(docWriter.getEmitter(), true); @@ -66,8 +66,7 @@ inline bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout) { } template -inline bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout, - void (T::*fn)(YAMLDocWriter& out) const) { +bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout, void (T::*fn)(YAMLDocWriter& out) const) { YAMLDocWriter docWriter(__GetDNAName(dna)); yaml_emitter_set_unicode(docWriter.getEmitter(), true); @@ -78,7 +77,7 @@ inline bool ToYAMLStream(const T& dna, athena::io::IStreamWriter& fout, } template -inline bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin) { +bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin) { YAMLDocReader docReader; if (!docReader.parse(&fin)) return false; @@ -87,7 +86,7 @@ inline bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin) { } template -inline bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin, void (T::*fn)(YAMLDocReader& in)) { +bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin, void (T::*fn)(YAMLDocReader& in)) { YAMLDocReader docReader; if (!docReader.parse(&fin)) return false; @@ -96,7 +95,7 @@ inline bool FromYAMLStream(T& dna, athena::io::IStreamReader& fin, void (T::*fn) } template -inline bool MergeToYAMLFile(const T& dna, const NameT& filename) { +bool MergeToYAMLFile(const T& dna, const NameT& filename) { athena::io::FileReader r(filename); YAMLDocWriter docWriter(__GetDNAName(dna), r.isOpen() ? &r : nullptr); r.close(); @@ -109,7 +108,7 @@ inline bool MergeToYAMLFile(const T& dna, const NameT& filename) { } template -inline bool ValidateFromYAMLStream(athena::io::IStreamReader& fin) { +bool ValidateFromYAMLStream(athena::io::IStreamReader& fin) { YAMLDocReader reader; atUint64 pos = fin.position(); yaml_parser_set_input(reader.getParser(), (yaml_read_handler_t*)YAMLAthenaReader, &fin); diff --git a/include/athena/Dir.hpp b/include/athena/Dir.hpp index e18d080..413800c 100644 --- a/include/athena/Dir.hpp +++ b/include/athena/Dir.hpp @@ -14,7 +14,7 @@ public: explicit Dir(std::string_view path); std::string absolutePath() const; - static inline std::string absolutePath(std::string_view path) { return Dir(path).absolutePath(); } + static std::string absolutePath(std::string_view path) { return Dir(path).absolutePath(); } bool isDir() const; static bool isDir(std::string_view dir) { return Dir(dir).isDir(); } diff --git a/include/athena/FileInfo.hpp b/include/athena/FileInfo.hpp index 1b8e01b..58cc753 100644 --- a/include/athena/FileInfo.hpp +++ b/include/athena/FileInfo.hpp @@ -10,33 +10,33 @@ public: explicit FileInfo(std::string_view path = {}); std::string absolutePath() const; - static inline std::string absolutePath(std::string_view lnk) { return FileInfo(lnk).absolutePath(); } + static std::string absolutePath(std::string_view lnk) { return FileInfo(lnk).absolutePath(); } std::string absoluteFilePath() const; - static inline std::string absoluteFilePath(std::string_view path) { return FileInfo(path).absoluteFilePath(); } + static std::string absoluteFilePath(std::string_view path) { return FileInfo(path).absoluteFilePath(); } std::string filename() const; - static inline std::string filename(std::string_view path) { return FileInfo(path).filename(); } + static std::string filename(std::string_view path) { return FileInfo(path).filename(); } std::string path() const { return m_path; } - static inline std::string path(std::string_view path) { return FileInfo(path).path(); } + static std::string path(std::string_view path) { return FileInfo(path).path(); } std::string extension() const; - static inline std::string extension(std::string_view path) { return FileInfo(path).extension(); } + static std::string extension(std::string_view path) { return FileInfo(path).extension(); } atUint64 size() const; - static inline atUint64 size(std::string_view path) { return FileInfo(path).size(); } + static atUint64 size(std::string_view path) { return FileInfo(path).size(); } bool exists() const; - static inline bool exists(std::string_view path) { return FileInfo(path).exists(); } + static bool exists(std::string_view path) { return FileInfo(path).exists(); } bool isLink() const; - static inline bool isLink(std::string_view lnk) { return FileInfo(lnk).isLink(); } + static bool isLink(std::string_view lnk) { return FileInfo(lnk).isLink(); } bool isFile() const; - static inline bool isFile(std::string_view path) { return FileInfo(path).isFile(); } + static bool isFile(std::string_view path) { return FileInfo(path).isFile(); } bool touch() const; - static inline bool touch(std::string_view path) { return FileInfo(path).touch(); } + static bool touch(std::string_view path) { return FileInfo(path).touch(); } private: std::string m_path; diff --git a/include/athena/FileReader.hpp b/include/athena/FileReader.hpp index 16e1f7f..a11e410 100644 --- a/include/athena/FileReader.hpp +++ b/include/athena/FileReader.hpp @@ -20,7 +20,7 @@ public: FileReader(std::wstring_view filename, atInt32 cacheSize = (32 * 1024), bool globalErr = true); virtual ~FileReader(); - inline std::string filename() const { + std::string filename() const { #if _WIN32 return utility::wideToUtf8(m_filename); #else @@ -28,7 +28,7 @@ public: #endif } - inline std::wstring wfilename() const { + std::wstring wfilename() const { #if _WIN32 return m_filename; #else @@ -38,7 +38,7 @@ public: void open(); void close(); - inline bool isOpen() const { return m_fileHandle != 0; } + bool isOpen() const { return m_fileHandle != 0; } bool save(); void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current); atUint64 position() const; diff --git a/include/athena/FileWriter.hpp b/include/athena/FileWriter.hpp index 3d8cf38..e104e7f 100644 --- a/include/athena/FileWriter.hpp +++ b/include/athena/FileWriter.hpp @@ -17,14 +17,14 @@ public: FileWriter(std::wstring_view filename, bool overwrite = true, bool globalErr = true); virtual ~FileWriter(); - inline std::string filename() const { + std::string filename() const { #if _WIN32 return utility::wideToUtf8(m_filename); #else return m_filename; #endif } - inline std::wstring wfilename() const { + std::wstring wfilename() const { #if _WIN32 return m_filename; #else @@ -34,7 +34,7 @@ public: void open(bool overwrite = true); void close(); - inline bool isOpen() const { return m_fileHandle != 0; } + bool isOpen() const { return m_fileHandle != 0; } void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current); atUint64 position() const; atUint64 length() const; @@ -99,8 +99,8 @@ public: m_position = 0; } - inline atUint64 position() const { return m_position; } - inline atUint64 length() const { return m_deferredBuffer.size(); } + atUint64 position() const { return m_position; } + atUint64 length() const { return m_deferredBuffer.size(); } void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current); void writeUBytes(const atUint8* data, atUint64 len); diff --git a/include/athena/Global.hpp b/include/athena/Global.hpp index 02b5309..100731f 100644 --- a/include/athena/Global.hpp +++ b/include/athena/Global.hpp @@ -137,13 +137,13 @@ template using __IsDNARecord = typename std::disjunction, T>, std::is_base_of, T>>; template -inline constexpr bool __IsDNARecord_v = __IsDNARecord::value; +constexpr bool __IsDNARecord_v = __IsDNARecord::value; template using __IsDNAVRecord = typename std::disjunction, T>, std::is_base_of, T>>; template -inline constexpr bool __IsDNAVRecord_v = __IsDNAVRecord::value; +constexpr bool __IsDNAVRecord_v = __IsDNAVRecord::value; } // namespace io } // namespace athena @@ -163,7 +163,7 @@ std::ostream& operator<<(std::ostream& os, const athena::Endian& endian); template constexpr auto __FIRST_ARG__(First first, Rest...) { return first; } template -inline auto __make_args_checked__(const S& format_str, Args&&... args) { +auto __make_args_checked__(const S& format_str, Args&&... args) { return fmt::internal::make_args_checked(format_str, std::forward(args)...); } diff --git a/include/athena/MemoryReader.hpp b/include/athena/MemoryReader.hpp index 1a82c27..821dba2 100644 --- a/include/athena/MemoryReader.hpp +++ b/include/athena/MemoryReader.hpp @@ -40,13 +40,13 @@ public: * * \return Int64 The current position in the stream. */ - inline atUint64 position() const { return m_position; } + atUint64 position() const { return m_position; } /*! \brief Returns whether or not the stream is at the end. * * \return bool True if at end; False otherwise. */ - inline atUint64 length() const { return m_length; } + atUint64 length() const { return m_length; } /*! \brief Sets the buffer to the given one, deleting the current one.
* BEWARE: As this deletes the current buffer it WILL cause a loss of data diff --git a/include/athena/MemoryWriter.hpp b/include/athena/MemoryWriter.hpp index 28c4d23..01f484f 100644 --- a/include/athena/MemoryWriter.hpp +++ b/include/athena/MemoryWriter.hpp @@ -37,15 +37,15 @@ public: * * @return Int64 The current position in the stream. */ - inline atUint64 position() const { return m_position; } + atUint64 position() const { return m_position; } /*! @brief Returns the length of the stream. * * @return Int64 The length of the stream. */ - inline atUint64 length() const { return m_length; } + atUint64 length() const { return m_length; } - inline bool isOpen() const { return true; } + bool isOpen() const { return true; } /** @brief Sets the buffer to the given one, deleting the current one if it owns it.
* @param data The new buffer. @@ -65,12 +65,12 @@ public: * * @param filepath The path to write to. */ - inline void setFilepath(const std::string& filepath) { m_filepath = filepath; } + void setFilepath(const std::string& filepath) { m_filepath = filepath; } /*! @brief * Returns the target file */ - inline std::string filepath() const { return m_filepath; } + std::string filepath() const { return m_filepath; } /*! @brief Saves the file to the specified file. * diff --git a/include/athena/VectorWriter.hpp b/include/athena/VectorWriter.hpp index f17e160..13c45d2 100644 --- a/include/athena/VectorWriter.hpp +++ b/include/athena/VectorWriter.hpp @@ -28,15 +28,15 @@ public: * * @return Int64 The current position in the stream. */ - inline atUint64 position() const { return m_position; } + atUint64 position() const { return m_position; } /*! @brief Returns the length of the stream. * * @return Int64 The length of the stream. */ - inline atUint64 length() const { return m_data.size(); } + atUint64 length() const { return m_data.size(); } - inline bool isOpen() const { return true; } + bool isOpen() const { return true; } /*! @brief Obtains reference to underlying std::vector store */ const std::vector& data() const { return m_data; } diff --git a/include/athena/YAMLCommon.hpp b/include/athena/YAMLCommon.hpp index 7617b14..01e56bd 100644 --- a/include/athena/YAMLCommon.hpp +++ b/include/athena/YAMLCommon.hpp @@ -27,14 +27,14 @@ struct YAMLNode { YAMLNode(yaml_node_type_t type) : m_type(type) {} - inline const YAMLNode* findMapChild(std::string_view key) const { + const YAMLNode* findMapChild(std::string_view key) const { for (const auto& item : m_mapChildren) if (!item.first.compare(key)) return item.second.get(); return nullptr; } - inline void assignMapChild(std::string_view key, std::unique_ptr&& node) { + void assignMapChild(std::string_view key, std::unique_ptr&& node) { for (auto& item : m_mapChildren) if (!item.first.compare(key)) { item.second = std::move(node); diff --git a/include/athena/YAMLDocReader.hpp b/include/athena/YAMLDocReader.hpp index 8fa4c00..06a1ab3 100644 --- a/include/athena/YAMLDocReader.hpp +++ b/include/athena/YAMLDocReader.hpp @@ -19,15 +19,15 @@ public: void reset(); - inline yaml_parser_t* getParser() { return &m_parser; } + yaml_parser_t* getParser() { return &m_parser; } bool parse(athena::io::IStreamReader* reader); bool ClassTypeOperation(std::function func); bool ValidateClassType(const char* expectedType); - inline const YAMLNode* getRootNode() const { return m_rootNode.get(); } - inline const YAMLNode* getCurNode() const { return m_subStack.empty() ? nullptr : m_subStack.back(); } + const YAMLNode* getRootNode() const { return m_rootNode.get(); } + const YAMLNode* getCurNode() const { return m_subStack.empty() ? nullptr : m_subStack.back(); } std::unique_ptr releaseRootNode() { return std::move(m_rootNode); } class RecordRAII { diff --git a/include/athena/YAMLDocWriter.hpp b/include/athena/YAMLDocWriter.hpp index ae9cbc4..b1f1d36 100644 --- a/include/athena/YAMLDocWriter.hpp +++ b/include/athena/YAMLDocWriter.hpp @@ -20,7 +20,7 @@ public: bool finish(athena::io::IStreamWriter* fout); - inline YAMLNode* getCurNode() const { return m_subStack.empty() ? nullptr : m_subStack.back(); } + YAMLNode* getCurNode() const { return m_subStack.empty() ? nullptr : m_subStack.back(); } class RecordRAII { friend class YAMLDocWriter;