diff --git a/include/athena/IStreamReader.hpp b/include/athena/IStreamReader.hpp index 6c66bf7..fbdd896 100644 --- a/include/athena/IStreamReader.hpp +++ b/include/athena/IStreamReader.hpp @@ -11,7 +11,7 @@ namespace athena::io { * virtual function that must be implemented in order to interact with the stream. * * Most implementing classes will only need to implement IStreamReader::readUBytesToBuf(void*, atUint64) for basic - * stream intearaction + * stream interaction */ class IStreamReader : public IStream { public: @@ -22,7 +22,7 @@ public: * @param position where in the buffer to seek * @param origin The Origin to seek relative to */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override = 0; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override = 0; /** @brief Sets the buffer's position relative to the next 64-byte aligned position.
*/ @@ -919,7 +919,10 @@ public: /** @brief Reads a string and advances the position in the file * - * @param fixedLen If non-negative, this is a fixed-length string read + * @param fixedLen If non-negative, this is a fixed-length string read. + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read string */ std::string readString(atInt32 fixedLen = -1, bool doSeek = true) { @@ -950,7 +953,10 @@ public: /** @brief Reads a wstring and advances the position in the file * - * @param fixedLen If non-negative, this is a fixed-length string read + * @param fixedLen If non-negative, this is a fixed-length string read. + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read wstring */ std::wstring readWString(atInt32 fixedLen = -1, bool doSeek = true) { @@ -983,7 +989,10 @@ public: /** @brief Reads a wstring assuming little-endian characters * and advances the position in the file * - * @param fixedLen If non-negative, this is a fixed-length string read + * @param fixedLen If non-negative, this is a fixed-length string read. + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read wstring */ std::wstring readWStringLittle(atInt32 fixedLen = -1, bool doSeek = true) { @@ -1017,6 +1026,9 @@ public: * and advances the position in the file * * @param fixedLen If non-negative, this is a fixed-length string read + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read wstring */ std::wstring readWStringBig(atInt32 fixedLen = -1, bool doSeek = true) { @@ -1048,7 +1060,10 @@ public: /** @brief Reads a u16string assuming big-endian characters * and advances the position in the file * - * @param fixedLen If non-negative, this is a fixed-length string read + * @param fixedLen If non-negative, this is a fixed-length string read. + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read wstring */ std::u16string readU16StringBig(atInt32 fixedLen = -1, bool doSeek = true) { @@ -1080,7 +1095,10 @@ public: /** @brief Reads a u32string assuming big-endian characters * and advances the position in the file * - * @param fixedLen If non-negative, this is a fixed-length string read + * @param fixedLen If non-negative, this is a fixed-length string read. + * @param doSeek Whether or not to reset the advanced position of the file. + * This is ignored if fixedLen is less than or equal to zero. + * * @return The read wstring */ std::u32string readU32StringBig(atInt32 fixedLen = -1, bool doSeek = true) { diff --git a/include/athena/IStreamWriter.hpp b/include/athena/IStreamWriter.hpp index 5dcfe20..28c9406 100644 --- a/include/athena/IStreamWriter.hpp +++ b/include/athena/IStreamWriter.hpp @@ -16,7 +16,7 @@ public: * @param position where in the buffer to seek * @param origin The location to seek relative to */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override = 0; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override = 0; /** @brief Sets the buffers position relative to the next 32-byte aligned position.
*/ @@ -72,7 +72,7 @@ public: * @param data The buffer to write * @param length The amount to write */ - virtual void writeUBytes(const atUint8* data, atUint64 len) = 0; + virtual void writeUBytes(const atUint8* data, atUint64 length) = 0; /** @brief Writes the given buffer with the specified length, buffers can be bigger than the length * however it's undefined behavior to try and write a buffer which is smaller than the given length. @@ -80,7 +80,7 @@ public: * @param data The buffer to write * @param length The amount to write */ - void writeBytes(const void* data, atUint64 len) { writeUBytes((atUint8*)data, len); } + void writeBytes(const void* data, atUint64 length) { writeUBytes((atUint8*)data, length); } /** @brief Writes an Int16 to the buffer and advances the buffer. * It also swaps the bytes depending on the platform and Stream settings. diff --git a/include/athena/MemoryReader.hpp b/include/athena/MemoryReader.hpp index 6d7064a..7c254f2 100644 --- a/include/athena/MemoryReader.hpp +++ b/include/athena/MemoryReader.hpp @@ -23,9 +23,10 @@ public: /*! \brief This constructor references an existing buffer to read from. * - * \param data The existing buffer - * \param length The length of the existing buffer - * \param takeOwnership Memory will be freed with the reader if set + * \param data The existing buffer. + * \param length The length of the existing buffer. + * \param takeOwnership Memory will be freed with the reader if set. + * \param globalErr Whether or not global errors are enabled. */ MemoryReader(const void* data, atUint64 length, bool takeOwnership = false, bool globalErr = true); @@ -34,7 +35,7 @@ public: * \param position where in the buffer to seek * \param origin The Origin to seek \sa SeekOrigin */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override; /*! \brief Returns the current position in the stream. * diff --git a/include/athena/MemoryWriter.hpp b/include/athena/MemoryWriter.hpp index b18a9bc..2adb0d6 100644 --- a/include/athena/MemoryWriter.hpp +++ b/include/athena/MemoryWriter.hpp @@ -21,8 +21,10 @@ public: /*! @brief This constructor references an existing buffer to write to in-place. * - * @param data The existing buffer - * @param length The length of the existing buffer + * @param data The existing buffer. + * @param length The length of the existing buffer. + * @param takeOwnership Whether or not this writer takes ownership of the supplied data buffer. + * If true, the buffer will be deleted by this when the destructor executes. */ explicit MemoryWriter(atUint8* data, atUint64 length, bool takeOwnership = false); @@ -31,7 +33,7 @@ public: * @param position where in the buffer to seek * @param origin The Origin to seek @sa SeekOrigin */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override; /*! @brief Returns the current position in the stream. * @@ -85,7 +87,7 @@ public: * @param data The buffer to write * @param length The amount to write */ - void writeUBytes(const atUint8* data, atUint64 len) override; + void writeUBytes(const atUint8* data, atUint64 length) override; protected: MemoryWriter() {} @@ -116,7 +118,7 @@ public: * @param position where in the buffer to seek * @param origin The Origin to seek @sa SeekOrigin */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override; /*! @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 @@ -135,7 +137,7 @@ public: * @param data The buffer to write * @param length The amount to write */ - void writeUBytes(const atUint8* data, atUint64 len) override; + void writeUBytes(const atUint8* data, atUint64 length) override; protected: std::unique_ptr m_dataCopy; diff --git a/include/athena/VectorWriter.hpp b/include/athena/VectorWriter.hpp index 7257812..3233f41 100644 --- a/include/athena/VectorWriter.hpp +++ b/include/athena/VectorWriter.hpp @@ -22,7 +22,7 @@ public: * @param position where in the buffer to seek * @param origin The Origin to seek @sa SeekOrigin */ - void seek(atInt64 pos, SeekOrigin origin = SeekOrigin::Current) override; + void seek(atInt64 position, SeekOrigin origin = SeekOrigin::Current) override; /*! @brief Returns the current position in the stream. * @@ -48,7 +48,7 @@ public: * @param data The buffer to write * @param length The amount to write */ - void writeUBytes(const atUint8* data, atUint64 len) override; + void writeUBytes(const atUint8* data, atUint64 length) override; protected: std::vector m_data;