forked from AdrianEddy/AIMPYouTube
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTools.h
31 lines (24 loc) · 1.27 KB
/
Tools.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#pragma once
#include <string>
#include <cinttypes>
#include <functional>
#include "Config.h"
#include "Strsafe.h"
#include "rapidjson/document.h"
#define DebugA(...) { char msg[2048]; sprintf_s(msg, __VA_ARGS__); OutputDebugStringA(msg); }
#define DebugW(...) { wchar_t msg[2048]; StringCchPrintfW(msg, sizeof(msg)/sizeof(wchar_t), __VA_ARGS__); OutputDebugStringW(msg); }
struct Tools {
static std::wstring ToWString(const std::string &);
static std::string ToString(const std::wstring &);
static std::wstring ToWString(const char *);
static std::wstring ToWString(const rapidjson::Value &);
static void ReplaceString(const std::string &search, const std::string &replace, std::string &subject);
static void SplitString(const std::string &string, const std::string &delimiter, std::function<void(const std::string &token)> callback);
static std::string Trim(const std::string &s);
static std::wstring TrackIdFromUrl(const std::wstring &);
static Config::TrackInfo *TrackInfo(const std::wstring &id);
static Config::TrackInfo *TrackInfo(IAIMPString *FileName);
static std::wstring UrlEncode(const std::wstring &);
static std::string UrlDecode(const std::string &input);
static void OutputLastError();
};