diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-09-05 12:08:52 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2014-09-05 12:08:52 +0000 |
commit | f82091b2af907fb1d120c305da75c57b09cb0e7b (patch) | |
tree | f76f25019d39f634696021d2d391669fec633f9c /plugins/!Deprecated/Skype/src/string_list.h | |
parent | 387bba529b2a8878a6c66661c09fc02622fe32ea (diff) |
SkypeKit based Skype plugin is moved to deprecated and will be deleted from Plugins folder by PluginUpdater
git-svn-id: http://svn.miranda-ng.org/main/trunk@10372 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/!Deprecated/Skype/src/string_list.h')
-rw-r--r-- | plugins/!Deprecated/Skype/src/string_list.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/!Deprecated/Skype/src/string_list.h b/plugins/!Deprecated/Skype/src/string_list.h new file mode 100644 index 0000000000..7cf3b0aee7 --- /dev/null +++ b/plugins/!Deprecated/Skype/src/string_list.h @@ -0,0 +1,61 @@ +#pragma once
+
+#include <algorithm>
+#include <vector>
+
+class StringList
+{
+private:
+ std::vector<std::wstring> strings;
+
+public:
+ StringList() {}
+ StringList(const wchar_t* string, const wchar_t *delimeters = L" ")
+ {
+ wchar_t *data = ::mir_wstrdup(string);
+ if (data)
+ {
+ wchar_t *p = ::wcstok(data, delimeters);
+ if (p)
+ {
+ this->strings.push_back(p);
+ while (p = wcstok(NULL, delimeters))
+ {
+ this->strings.push_back(p);
+ }
+ }
+ ::mir_free(data);
+ }
+ }
+ virtual ~StringList() { }
+
+ __inline const wchar_t *operator[](size_t idx) const
+ {
+ return (idx >= 0 && idx < this->size()) ? this->strings[idx].c_str() : NULL;
+ }
+
+ __inline void insert(const wchar_t* p)
+ {
+ this->strings.push_back(::mir_wstrdup(p));
+ }
+
+ __inline bool contains(const wchar_t* p) const
+ {
+ return std::find(this->strings.begin(), this->strings.end(), p) != this->strings.end();
+ }
+
+ __inline size_t size() const
+ {
+ return this->strings.size();
+ }
+
+ __inline bool empty() const
+ {
+ return this->strings.empty();
+ }
+
+ __inline void clear()
+ {
+ this->strings.clear();
+ }
+};
\ No newline at end of file |