My Project
|
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 #pragma once 00029 #include "Define.h" 00030 #include "StringHelper.h" 00031 #include "NetworkHelper.h" 00032 #include "SallyHelper.h" 00033 00034 namespace SallyAPI 00035 { 00036 namespace Media 00037 { 00043 00044 enum COVER_SIZE {COVER_SIZE_BIG, COVER_SIZE_MEDIUM, COVER_SIZE_SMALL}; 00045 00054 00055 class DLL_API_SALLY CAmazonInfo 00056 { 00057 private: 00058 std::string NormalizeString(const std::string& in); 00059 void CleanupStrings(std::string& artist, std::string& album); 00060 bool DownloadImage(std::string& imageURL, std::string& outputFile); 00061 void GetXML(std::string& queryString, std::string type, std::string responseGroup, 00062 std::string* response); 00063 00064 bool GetInfoInternal(std::string& searchKey, std::map<std::string, std::string>& info, 00065 std::string& outputFile, std::string& tempFile, COVER_SIZE size); 00066 bool GetCoverInternal(std::string& artist, std::string& album, std::string& outputFile, 00067 std::string& tempFile, COVER_SIZE size); 00068 public: 00069 CAmazonInfo(); 00070 ~CAmazonInfo(); 00071 00072 bool GetMusicCover(std::string artist, std::string album, std::string outputFile, 00073 COVER_SIZE size = COVER_SIZE_BIG); 00074 bool GetDVDInfo(std::string sarchKey, std::map<std::string, std::string>& info, 00075 std::string outputFile, COVER_SIZE size = COVER_SIZE_BIG); 00076 }; 00077 } 00078 }