aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/service/svccache.cpp
diff options
context:
space:
mode:
authorJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
committerJef <jef@targetspot.com>2024-09-24 08:54:57 -0400
commit20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch)
tree12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Wasabi/api/service/svccache.cpp
parent537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff)
downloadwinamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz
Initial community commit
Diffstat (limited to 'Src/Wasabi/api/service/svccache.cpp')
-rw-r--r--Src/Wasabi/api/service/svccache.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/Src/Wasabi/api/service/svccache.cpp b/Src/Wasabi/api/service/svccache.cpp
new file mode 100644
index 00000000..af3e47cf
--- /dev/null
+++ b/Src/Wasabi/api/service/svccache.cpp
@@ -0,0 +1,35 @@
+#include <precomp.h>
+#include "svccache.h"
+#include <bfc/string/bfcstring.h>
+
+#if !defined(WASABI_API_SVC)
+#error no no
+#endif
+
+SvcCache::SvcCache(FOURCC type) {
+ int p = 0;
+ list.setAutoSort(FALSE);
+ for (;;) {
+ waServiceFactory *svc = WASABI_API_SVC->service_enumService(type, p++);
+ if (svc == NULL) break;
+ const wchar_t *teststr = svc->getTestString();
+ if (teststr == NULL || *teststr == '\0') continue;
+//CUT DebugString("cachin %s\n", teststr);
+ list.addItem(svc);
+ }
+ list.setAutoSort(TRUE);
+}
+
+waServiceFactory *SvcCache::findServiceFactory(const wchar_t *searchval) {
+ return list.findItem(searchval);
+}
+
+int SvcCache::waServiceFactoryCompare::compareItem(waServiceFactory *p1, waServiceFactory* p2) {
+ int r = WCSICMP(p1->getTestString(), p2->getTestString());
+ if (r == 0) return CMP3(p1, p2);
+ return r;
+}
+
+int SvcCache::waServiceFactoryCompare::compareAttrib(const wchar_t *attrib, waServiceFactory *item) {
+ return WCSICMP(attrib, item->getTestString());
+}