Rudiments
|
#include <bytestring.h>
The bytestring class provides methods for manipulating byte strings.
In addition to some unique methods, analogs for the standard C "memory" functions are provided. However, unlike the standard C functions, the bytestring methods are NULL safe. Your application will not crash if a NULL is passed in, and instead, will give intuitive results.
Returns an integer less than, equal to or greater than 0 if "size" bytes of "s1" are less than, equal to or greater than "size" bytes of "s2".
Copies "size" bytes from "src" into "dest". "src" and "dest" may NOT overlap. Returns a pointer to "dest".
Copies "size" bytes from "src" into "dest" while swapping byte order. Useful for exchanging data between big and little endian machines. "src" and "dest" may NOT overlap. Returns a pointer to "dest".
|
static |
Copies bytes from "src" into "dest" until "character" is encountered in "src" or "size" bytes have been copied. "src" and "dest" may NOT overlap. Returns a pointer to "dest".
Copies "size" bytes from "src" to "dest". "src" and "dest" may overlap. Returns a pointer to "dest".
Allocates a buffer of "size" bytes, copies "size" bytes of "src" into it and returns the buffer.
|
static |
Returns a pointer to the first occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
|
static |
Returns a pointer to the first occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
Returns a pointer to the first occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
|
static |
Returns a pointer to the first occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
|
static |
Returns a pointer to the last occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
|
static |
Returns a pointer to the last occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
Returns a pointer to the last occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
|
static |
Returns a pointer to the last occurrance of "needle" in the first "size" bytes of "haystack". Returns NULL if no match is found.
Sets "size" bytes of "dest" to "character". Returns a pointer to "dest".