| 1 | #pragma once |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * @ingroup NSClient++ |
|---|
| 5 | * |
|---|
| 6 | * A simple namespace (wrapper) to wrap functions to manipulate an array buffer. |
|---|
| 7 | * |
|---|
| 8 | * @version 1.0 |
|---|
| 9 | * first version |
|---|
| 10 | * |
|---|
| 11 | * @date 05-14-2005 |
|---|
| 12 | * |
|---|
| 13 | * @author mickem |
|---|
| 14 | * |
|---|
| 15 | * @par license |
|---|
| 16 | * This code is absolutely free to use and modify. The code is provided "as is" with |
|---|
| 17 | * no expressed or implied warranty. The author accepts no liability if it causes |
|---|
| 18 | * any damage to your computer, causes your pet to fall ill, increases baldness |
|---|
| 19 | * or makes your car start emitting strange noises when you start it up. |
|---|
| 20 | * This code has no bugs, just undocumented features! |
|---|
| 21 | * |
|---|
| 22 | * @todo |
|---|
| 23 | * |
|---|
| 24 | * @bug |
|---|
| 25 | * |
|---|
| 26 | */ |
|---|
| 27 | namespace arrayBuffer { |
|---|
| 28 | typedef std::list<std::string> arrayList; |
|---|
| 29 | arrayList arrayBuffer2list(const unsigned int argLen, char **argument); |
|---|
| 30 | char ** list2arrayBuffer(const arrayList lst, unsigned int &argLen); |
|---|
| 31 | char ** split2arrayBuffer(const char* buffer, char splitChar, unsigned int &argLen); |
|---|
| 32 | char ** split2arrayBuffer(const std::string buffer, char splitChar, unsigned int &argLen); |
|---|
| 33 | std::string arrayBuffer2string(char **argument, const unsigned int argLen, std::string join); |
|---|
| 34 | char ** createEmptyArrayBuffer(unsigned int &argLen); |
|---|
| 35 | void destroyArrayBuffer(char **argument, const unsigned int argLen); |
|---|
| 36 | |
|---|
| 37 | #ifdef _DEBUG |
|---|
| 38 | void test_createEmptyArrayBuffer(); |
|---|
| 39 | void test_split2arrayBuffer_str(std::string buffer, char splitter, int OUT_argLen); |
|---|
| 40 | void test_split2arrayBuffer_char(char* buffer, char splitter, int OUT_argLen); |
|---|
| 41 | void run_testArrayBuffer(); |
|---|
| 42 | #endif |
|---|
| 43 | } |
|---|