2015-06-28 21:09:21 +00:00
|
|
|
|
|
|
|
#ifndef STRING_SPLIT_H
|
|
|
|
#define STRING_SPLIT_H
|
|
|
|
|
2017-12-28 18:05:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2015-06-28 21:09:21 +00:00
|
|
|
#include <cstring>
|
|
|
|
#include <string>
|
|
|
|
#include "LinearMath/btAlignedObjectArray.h"
|
|
|
|
|
2016-07-16 07:55:56 +00:00
|
|
|
void urdfStringSplit( btAlignedObjectArray<std::string>&pieces, const std::string& vector_str, const btAlignedObjectArray<std::string>& separators);
|
2015-06-28 21:09:21 +00:00
|
|
|
|
2016-07-16 07:55:56 +00:00
|
|
|
void urdfIsAnyOf(const char* seps, btAlignedObjectArray<std::string>& strArray);
|
2017-12-28 18:05:51 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2015-06-28 21:09:21 +00:00
|
|
|
|
|
|
|
///The string split C code is by Lars Wirzenius
|
|
|
|
///See http://stackoverflow.com/questions/2531605/how-to-split-a-string-with-a-delimiter-larger-than-one-single-char
|
|
|
|
|
|
|
|
|
|
|
|
/* Split a string into substrings. Return dynamic array of dynamically
|
|
|
|
allocated substrings, or NULL if there was an error. Caller is
|
|
|
|
expected to free the memory, for example with str_array_free. */
|
|
|
|
char** urdfStrSplit(const char* input, const char* sep);
|
|
|
|
|
|
|
|
/* Free a dynamic array of dynamic strings. */
|
|
|
|
void urdfStrArrayFree(char** array);
|
|
|
|
|
|
|
|
/* Return length of a NULL-delimited array of strings. */
|
|
|
|
size_t urdfStrArrayLen(char** array);
|
|
|
|
|
2017-12-28 18:05:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2015-06-28 21:09:21 +00:00
|
|
|
#endif //STRING_SPLIT_H
|
|
|
|
|