* \brief split a string at sep chars and return a SimpleVector of strings */
| 167 | * \brief split a string at sep chars and return a SimpleVector of strings |
| 168 | */ |
| 169 | static lout::misc::SimpleVector<char *> *splitStr (const char *str, char sep) { |
| 170 | const char *p1 = NULL; |
| 171 | lout::misc::SimpleVector<char *> *list = |
| 172 | new lout::misc::SimpleVector<char *> (1); |
| 173 | |
| 174 | for (;; str++) { |
| 175 | if (*str != '\0' && *str != sep) { |
| 176 | if (!p1) |
| 177 | p1 = str; |
| 178 | } else if (p1) { |
| 179 | list->increase (); |
| 180 | list->set (list->size () - 1, dStrndup (p1, str - p1)); |
| 181 | p1 = NULL; |
| 182 | } |
| 183 | |
| 184 | if (*str == '\0') |
| 185 | break; |
| 186 | } |
| 187 | |
| 188 | return list; |
| 189 | } |
| 190 | |
| 191 | void StyleEngine::setClass (const char *klass) { |
| 192 | DoctreeNode *dn = doctree->top (); |