unsigned char array
Dependents: MGC3130 SmartLabXBeeCore
Diff: BufferedArray.h
- Revision:
- 2:765da30c4d9b
- Parent:
- 1:77c1ea04eb5a
--- a/BufferedArray.h Thu Nov 12 02:06:49 2015 +0000 +++ b/BufferedArray.h Thu Nov 12 02:41:54 2015 +0000 @@ -10,21 +10,21 @@ { protected : /// initial size and automatically increase length. - int expandSize; + unsigned int expandSize; /// Raw data unsigned char * data; /// Current index of the data, could also used as data lendth. - int index; + unsigned long index; /// Max data size that the raw data can hold. - int max; + unsigned long max; - void expandSpace(int length); + void expandSpace(unsigned long length); public: - BufferedArray(int initialLength, int expandSize); + BufferedArray(unsigned int initialLength, unsigned int expandSize); BufferedArray(BufferedArray * bufferedArray); @@ -41,7 +41,7 @@ * * @returns unsigned char array. */ - unsigned char * gets(int position); + unsigned char * gets(unsigned long position); /** Get 1 byte data from a specific location. * @@ -49,7 +49,7 @@ * * @returns unsigned char. */ - unsigned char get(int position); + unsigned char get(unsigned long position); /** Get the current index. * @returns unsigned char array. @@ -59,12 +59,12 @@ /** Set the index within the max length of raw data. * @param position where to begin read and write */ - void setPosition(int position); + void setPosition(unsigned long position); /** Reset the raw data. * @param length current max size for the raw data */ - void allocate(int length); + void allocate(unsigned long length); /** Reset the position and does not affect the content of the data. * @param length current max size for the raw data @@ -81,13 +81,13 @@ * @param offset start point of the data * @param length length to write */ - void sets(const unsigned char * value, int offset, int length); + void sets(const unsigned char * value, unsigned long offset, unsigned long length); /** Write 8-bit data into specific posiston and deos not affect the current position. * @param position where to write * @param value sigle byte */ - void set(int position, unsigned char value); + void set(unsigned long position, unsigned char value); /** Write array of data into specific posiston and deos not affect the current position. * @param position where to write @@ -95,7 +95,7 @@ * @param offset start point of the data * @param length length to write */ - void sets(int position, const unsigned char * value, int offset, int length); -}; + void sets(unsigned long position, const unsigned char * value, unsigned long offset, unsigned long length); +}; #endif