diff options
author | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
---|---|---|
committer | Jef <jef@targetspot.com> | 2024-09-24 08:54:57 -0400 |
commit | 20d28e80a5c861a9d5f449ea911ab75b4f37ad0d (patch) | |
tree | 12f17f78986871dd2cfb0a56e5e93b545c1ae0d0 /Src/Winamp/urlmanager.cpp | |
parent | 537bcbc86291b32fc04ae4133ce4d7cac8ebe9a7 (diff) | |
download | winamp-20d28e80a5c861a9d5f449ea911ab75b4f37ad0d.tar.gz |
Initial community commit
Diffstat (limited to 'Src/Winamp/urlmanager.cpp')
-rw-r--r-- | Src/Winamp/urlmanager.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Src/Winamp/urlmanager.cpp b/Src/Winamp/urlmanager.cpp new file mode 100644 index 00000000..c034e8dd --- /dev/null +++ b/Src/Winamp/urlmanager.cpp @@ -0,0 +1,36 @@ +#include "urlmanager.h" + +const wchar_t *URLManager::GetURL(const wchar_t *urlid) +{ + for (URLList::iterator itr=urls.begin();itr!=urls.end();itr++) + { + if (!_wcsicmp(urlid, itr->urlid)) + { + return itr->url; + } + } + return 0; +} + +void URLManager::AddURL(const wchar_t *urlid, const wchar_t *url) +{ + for (URLList::iterator itr=urls.begin();itr!=urls.end();itr++) + { + if (!_wcsicmp(urlid, itr->urlid)) + { + free(itr->url); + itr->url=_wcsdup(url); + return ; + } + } + URLS newUrl; + newUrl.urlid = _wcsdup(urlid); + newUrl.url = _wcsdup(url); + urls.push_back(newUrl); +} + +#define CBCLASS URLManager +START_DISPATCH; +CB(API_URLMANAGER_GETURL, GetURL); +END_DISPATCH; +#undef CBCLASS
\ No newline at end of file |