diff options
| author | Karel Klic <kklic@redhat.com> | 2009-11-12 16:58:07 +0100 |
|---|---|---|
| committer | Karel Klic <kklic@redhat.com> | 2009-11-12 16:58:07 +0100 |
| commit | 32cee84a34c005fe0d2863f439007ec633687fa8 (patch) | |
| tree | 149ca7014e4295de3788f28ae88e9d9d7003da46 /lib/Utils/stringops.cpp | |
| parent | 5a8a8a6c99c9067e0dfcce839c32826a2badff0b (diff) | |
| parent | 3938e6e075867ae3a349ba307ee672aa458d2662 (diff) | |
| download | abrt-32cee84a34c005fe0d2863f439007ec633687fa8.tar.gz abrt-32cee84a34c005fe0d2863f439007ec633687fa8.tar.xz abrt-32cee84a34c005fe0d2863f439007ec633687fa8.zip | |
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib/Utils/stringops.cpp')
| -rw-r--r-- | lib/Utils/stringops.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/Utils/stringops.cpp b/lib/Utils/stringops.cpp new file mode 100644 index 0000000..1b3793f --- /dev/null +++ b/lib/Utils/stringops.cpp @@ -0,0 +1,30 @@ +#include "abrtlib.h" + +void parse_args(const char *psArgs, vector_string_t& pArgs, int quote) +{ + unsigned ii; + bool is_quote = false; + std::string item; + + for (ii = 0; psArgs[ii]; ii++) + { + if (quote != -1 && psArgs[ii] == quote) + { + is_quote = !is_quote; + } + else if (psArgs[ii] == ',' && !is_quote) + { + pArgs.push_back(item); + item.clear(); + } + else + { + item += psArgs[ii]; + } + } + + if (item.size() != 0) + { + pArgs.push_back(item); + } +} |
