From: Ingo Ruhnke Date: Mon, 22 Mar 2004 15:25:15 +0000 (+0000) Subject: - added read_string_vector X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=256958447aec9101378c9a0afea9146e5912c5ec;p=supertux.git - added read_string_vector SVN-Revision: 321 --- diff --git a/src/lispreader.cpp b/src/lispreader.cpp index c51cae9c8..db0b5c308 100644 --- a/src/lispreader.cpp +++ b/src/lispreader.cpp @@ -1060,6 +1060,22 @@ LispReader::read_float (const char* name, float* f) } bool +LispReader::read_string_vector (const char* name, std::vector* vec) +{ + lisp_object_t* obj = search_for (name); + if (obj) + { + while(!lisp_nil_p(obj)) + { + vec->push_back(lisp_string(lisp_car(obj))); + obj = lisp_cdr(obj); + } + return true; + } + return false; +} + +bool LispReader::read_int_vector (const char* name, std::vector* vec) { lisp_object_t* obj = search_for (name); diff --git a/src/lispreader.h b/src/lispreader.h index ad2fbbe69..2438ba3ab 100644 --- a/src/lispreader.h +++ b/src/lispreader.h @@ -171,6 +171,7 @@ class LispReader bool read_int_vector (const char* name, std::vector* vec); bool read_char_vector (const char* name, std::vector* vec); + bool read_string_vector (const char* name, std::vector* vec); bool read_string (const char* name, std::string* str); bool read_int (const char* name, int* i); bool read_float (const char* name, float* f);