7 #ifndef NAZARA_BYTEARRAY_HPP 8 #define NAZARA_BYTEARRAY_HPP 10 #include <Nazara/Prerequesites.hpp> 11 #include <Nazara/Core/String.hpp> 20 using Container = std::vector<UInt8>;
24 using allocator_type = Container::allocator_type;
25 using const_iterator = Container::const_iterator;
26 using const_reference = Container::const_reference;
27 using const_pointer = Container::const_pointer;
28 using const_reverse_iterator = Container::const_reverse_iterator;
29 using difference_type = Container::difference_type;
30 using pointer = Container::pointer;
31 using iterator = Container::iterator;
32 using reference = Container::reference;
33 using reverse_iterator = Container::reverse_iterator;
34 using size_type = Container::size_type;
35 using value_type = Container::value_type;
40 inline ByteArray(
const void* buffer, size_type n);
41 inline ByteArray(size_type n, value_type value);
42 template <
class InputIterator>
ByteArray(InputIterator first, InputIterator last);
47 inline iterator Append(
const void* buffer, size_type size);
48 inline iterator Append(
const ByteArray& other);
49 template <
class InputIterator>
void Assign(InputIterator first, InputIterator last);
50 inline void Assign(size_type n, value_type value);
52 inline reference Back();
53 inline const_reference Back()
const;
55 inline void Clear(
bool keepBuffer =
false);
57 inline iterator Erase(const_iterator pos);
58 inline iterator Erase(const_iterator first, const_iterator last);
60 inline reference Front();
61 inline const_reference Front()
const;
63 inline allocator_type GetAllocator()
const;
64 inline pointer GetBuffer();
65 inline size_type GetCapacity()
const noexcept;
66 inline const_pointer GetConstBuffer()
const;
67 inline size_type GetMaxSize()
const noexcept;
68 inline size_type GetSize()
const noexcept;
69 inline ByteArray GetSubArray(const_iterator startPos, const_iterator endPos)
const;
71 inline iterator Insert(const_iterator pos,
const void* buffer, size_type n);
72 inline iterator Insert(const_iterator pos,
const ByteArray& other);
73 inline iterator Insert(const_iterator pos, size_type n, value_type byte);
74 template <
class InputIterator> iterator Insert(const_iterator pos, InputIterator first, InputIterator last);
75 inline bool IsEmpty()
const noexcept;
77 inline void PopBack();
78 inline void PopFront();
79 inline iterator Prepend(
const void* buffer, size_type size);
80 inline iterator Prepend(
const ByteArray& other);
81 inline void PushBack(value_type byte);
82 inline void PushFront(value_type byte);
84 inline void Reserve(size_type bufferSize);
85 inline void Resize(size_type newSize);
86 inline void Resize(size_type newSize, value_type byte);
88 inline void ShrinkToFit();
92 inline String ToString()
const;
95 inline iterator begin() noexcept;
96 inline const_iterator begin()
const noexcept;
97 inline bool empty()
const noexcept;
98 inline iterator end() noexcept;
99 inline const_iterator end()
const noexcept;
100 inline reverse_iterator rbegin() noexcept;
101 inline const_reverse_iterator rbegin()
const noexcept;
102 inline reverse_iterator rend() noexcept;
103 inline const_reverse_iterator rend()
const noexcept;
104 inline const_iterator cbegin()
const noexcept;
105 inline const_iterator cend()
const noexcept;
106 inline const_reverse_iterator crbegin()
const noexcept;
107 inline const_reverse_iterator crend()
const noexcept;
108 inline size_type size()
const noexcept;
111 NAZARA_CORE_API
friend std::ostream& operator<<(std::ostream& out,
const Nz::ByteArray& byteArray);
113 inline reference operator[](size_type pos);
114 inline const_reference operator[](size_type pos)
const;
139 #include <Nazara/Core/ByteArray.inl> 141 #endif // NAZARA_BYTEARRAY_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Core class that represents the behaviour of the hash classes.
Definition: AbstractHash.hpp:18
bool operator<(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1517
String operator+(char character, const String &string)
Concatenates the character to the string.
Definition: String.cpp:5506
bool operator>(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1566
Core class that represents a string.
Definition: String.hpp:22
bool operator!=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1503
Core class that represents an array of bytes.
Definition: ByteArray.hpp:18
bool operator==(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1469
bool operator>=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1580
bool operator<=(const Bitset< Block, Allocator > &lhs, const Nz::Bitset< Block, Allocator > &rhs)
Compares two bitsets.
Definition: Bitset.inl:1552