Proud::ByteArray Class Reference
Inheritance diagram for Proud::ByteArray:

Public Types

typedef CFastArray< uint8_t,
false, true, int > 
Base
 

Public Member Functions

 ByteArray ()
 
 ByteArray (const uint8_t *data, int count)
 
 ByteArray (const ByteArray &src)
 
PROUD_API String ToHexString ()
 
PROUD_API bool FromHexString (String text)
 
- Public Member Functions inherited from Proud::CFastArray< uint8_t, false, true, int >
 CFastArray ()
 
 CFastArray (const uint8_t *data, intcount)
 
 CFastArray (const CFastArray &src)
 
void SetGrowPolicy (GrowPolicy val)
 
GrowPolicy GetGrowPolicy ()
 
void SetMinCapacity (intnewCapacity)
 
void SetCapacity (intnewCapacity)
 
void SuspendShrink ()
 
void OnRecycle ()
 
void OnDrop ()
 
void SetCount (intnewVal)
 
void AddCount (intaddLength)
 
void resize (intsz)
 for STL compatibility
 
int GetCapacity () const
 
int GetCount () const
 
int size () const
 for STL compatibility
 
bool IsEmpty () const
 
void Clear ()
 
void ClearAndKeepCapacity ()
 
T_IN ElementAt (intindex) const
 
uint8_t & ElementAt (intindex)
 
T_IN operator[] (intindex) const
 
uint8_t & operator[] (intindex)
 
uint8_t * GetData ()
 
const uint8_t * GetData () const
 
void Add (T_IN value)
 
void push_back (T_IN value)
 
void Insert (intindexAt, T_IN value)
 
void AddRange (const uint8_t *data, intcount)
 
void InsertRange (intindexAt, const uint8_t *data, intcount)
 
void CopyRangeTo (CFastArray &dest, intsrcOffset, intcount) const
 
void CopyTo (CFastArray &dest) const
 
void CopyFrom (const CFastArray &src)
 
void CopyFrom (const uint8_t *from, intfromCount)
 
void RemoveRange (intindex, intcount)
 
void RemoveAt (intindex)
 
bool RemoveOneByValue (T_IN value)
 
CFastArrayoperator= (const CFastArray &src)
 
int FindByValue (T_IN value)
 
bool Contains (T_IN value)
 
bool Equals (const CFastArray &rhs) const
 
void clear ()
 for STL compatibility
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator iter)
 
uint8_t PopBack ()
 
void RemoveAndPullLast (intindex)
 
virtual void DataBlock_Free (void *data)
 
virtual void * DataBlock_Alloc (size_t length)
 
virtual void * DataBlock_Realloc (void *oldPtr, size_t newLength)
 

Additional Inherited Members

- Static Public Attributes inherited from Proud::CFastArray< uint8_t, false, true, int >
static const size_t TYPE_SIZE
 
- Protected Member Functions inherited from Proud::CFastArray< uint8_t, false, true, int >
void InitVars ()
 
virtual int GetRecommendedCapacity (intactualCount)
 
void BoundCheck (intindex) const
 
- Protected Attributes inherited from Proud::CFastArray< uint8_t, false, true, int >
uint8_t * m_Data
 
int m_Length
 
int m_Capacity
 
int m_minCapacity
 
bool m_suspendShrink
 
GrowPolicy m_growPolicy
 

Detailed Description

TODO:translate needed. Byte array. It is optimized for the use of ProudNet

  • Since the purpose is to give and receive network packets, use is mandatory only in int32
  • The ByteArray is overridden in the operator new and delete, so it approaches fast heap. When using, the caution rules of Proud.CFastHeap must be complied with

Constructor & Destructor Documentation

Proud::ByteArray::ByteArray ( )
inline

Defalut constructor

Proud::ByteArray::ByteArray ( const uint8_t *  data,
int  count 
)
inline

TODO:translate needed. Constructor copies external data

Parameters
data
count
Proud::ByteArray::ByteArray ( const ByteArray src)
inline

TODO:translate needed. Constructor copies external data

Parameters
src

Member Function Documentation

PROUD_API bool Proud::ByteArray::FromHexString ( String  text)

TODO:translate needed. A hexadecimal array string is converted into a hexadecimal number

Parameters
hexadecimalarray String (ex. Text = L"FFFFEAB12")
Returns
conversion is successful, it is true. If failed, it is false.
PROUD_API String Proud::ByteArray::ToHexString ( )

TODO:translate needed. The array is returned by being transformed in a hexadecimal string

Returns
Hexadecimal array converted with String (ex: L”FFAB123”)