Doing some refactoring and some skeleton work for downloading songs

This commit is contained in:
kdeng00
2019-11-29 19:54:10 -05:00
parent d199b482ad
commit 1e70f84622
46 changed files with 1859 additions and 1341 deletions
+35
View File
@@ -0,0 +1,35 @@
//
// Created by brahmix on 11/25/19.
//
#ifndef MEAR_GENERALUTILITY_H
#define MEAR_GENERALUTILITY_H
#include <string>
#include "../model/Token.h"
namespace utility {
class GeneralUtility {
public:
template<typename S = std::string>
static S appendForwardSlashToUri(const S& uri) {
S fullUri(uri);
if (fullUri.at(fullUri.size() - 1) != '/') {
fullUri.append("/");
}
return fullUri;
}
template<typename S = std::string, class Token = model::Token>
static S authHeader(const Token& token) {
std::string header("Authorization: Bearer ");
header.append(token.accessToken);
return header;
}
private:
};
}
#endif //MEAR_GENERALUTILITY_H