亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? psp_rss_feed.cpp

?? PSP_RSS_feed-2.0-src.zip這是使用C++實現的RSS FEED想學的下載,不錯
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
			{
				//Frame Header is four characters,
				//four bytes for size
				//	(Size is 28-bit integer composed of the
				//	 last 7 bits of each byte, most significant 
				//	 first [except in the case of the MCDI frame]. 
				//	 It does not include the 10 byte frame header.),
				//2 bytes for flags, 
				//and 1 byte for text type
				//	(0x00 = ISO-8859-1, 
				//	 0x01 = UTF-16,
				//	 0x02 = UTF-16BE,
				//	 0x03 = UTF-8)
				audiofile.seekg(cursor);
//Debug
//printf("pointer = %X\ncursor = %X\n", (int)audiofile.tellg(), cursor);
				audiofile.readsome(temp, 10);
				cursor += 10;
				i=4;

				//Padding at end of ID3 tag (supposedly version 4 and up only, but it is in version 3 sometimes)
				if (temp[0]==0)
					break;
				//The MCDI frame size is a direct 32-bit integer
				else if (temp[0]=='M' && temp[1]=='C' && temp[2]=='D' && temp[3]=='I')
				{
					//Most Significant byte * 256^3
					frame_length = (temp[i++] & 0xFF)*16777216;
					//Next to Most Significant byte * 256^2
					frame_length += (temp[i++] & 0xFF)*65536;
					//Next Least Significant byte * 256
					frame_length += (temp[i++] & 0xFF)*256;
					//Least Significant byte
					frame_length += (temp[i++] & 0xFF);
				}
				else
				{
					//Most Significant byte * 128^3
					frame_length = (temp[i++] & 0xFF)*2097152;
					//Next to Most Significant byte * 128^2
					frame_length += (temp[i++] & 0xFF)*16384;
					//Next Least Significant byte * 128
					frame_length += (temp[i++] & 0xFF)*128;
					//Least Significant byte
					frame_length += (temp[i++] & 0xFF);
				}

				//Check for major screw up
				if (frame_length > (id3_length - cursor))
					break;

				temp[4]=0;
//Debug
//printf("temp = %s\nframe_length = %X, temp[5-9] = %02X%02X%02X%02X%02X\n", temp, frame_length, temp[5] & 0xFF, temp[6] & 0xFF, temp[7] & 0xFF, temp[8] & 0xFF, temp[9] & 0xFF);

				if (strcmp(temp, "TIT2") == 0 && default_title == true)
				{
					audiofile.seekg(cursor);
					audiofile.readsome(temp, 1);
					cursor += 1;
					frame_length--;

					//If UTF-16
					if (temp[0] == 0x01 || temp[0] == 0x02)
					{
						while (frame_length > 0)
						{
							//If less than 1024 bytes left read difference
							if (frame_length < 1024)
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, frame_length);
								cursor += frame_length;
								remove_nulls(temp, frame_length);
								frame_length=0;
							}
							else
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, 1024);
								cursor += 1024;
								remove_nulls(temp, 1024);
								frame_length -= 1024;
							}
							title += temp;
							temp[0]=0;
						}
					}
					//If ISO or UTF-8 or other
					else //if (temp[0] == 0x00 || temp[0] == 0x03)
					{
						while (frame_length > 0)
						{
							//If less than 1024 bytes left read difference
							if (frame_length < 1024)
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, frame_length);
								cursor += frame_length;
								temp[frame_length]=0;
								frame_length=0;
							}
							else
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, 1024);
								cursor += 1024;
								frame_length -= 1024;
							}
							title += temp;
//Debug
//printf("temp = %s\ntitle = %s\n", temp, title.c_str());
							temp[0]=0;
						}
					}
					default_title = false;
				}
				else if (strcmp(temp, "TPE1") == 0 && default_author == true)
				{
					audiofile.seekg(cursor);
					audiofile.readsome(temp, 1);
					cursor += 1;
					frame_length--;
//Debug
//printf("temp[0] = %X\n", temp[0]);

					//If UTF-16
					if (temp[0] == 0x01 || temp[0] == 0x02)
					{
						while (frame_length > 0)
						{
							//If less than 1024 bytes left read difference
							if (frame_length < 1024)
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, frame_length);
								cursor += frame_length;
								remove_nulls(temp, frame_length);
								frame_length=0;
							}
							else
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, 1024);
								cursor += 1024;
								remove_nulls(temp, 1024);
								frame_length -= 1024;
							}
							author += temp;
							temp[0]=0;
						}
					}
					//If ISO or UTF-8 or other
					else //if (temp[0] == 0x00 || temp[0] == 0x03)
					{
						while (frame_length > 0)
						{
							//If less than 1024 bytes left read difference
							if (frame_length < 1024)
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, frame_length);
								cursor += frame_length;
								temp[frame_length]=0;
								frame_length=0;
							}
							else
							{
								audiofile.seekg(cursor);
								audiofile.readsome(temp, 1024);
								cursor += 1024;
								frame_length -= 1024;
							}
							author += temp;
//Debug
//printf("temp = %s\nauthor = %s\n", temp, author.c_str());
							temp[0]=0;
						}
					}
					default_author = false;
				}
				else
				{
					cursor += frame_length;
					frame_length=0;
				}
			}
			//Check for blank values
			if (default_author == false && author == "")
				default_author == true;
			printf("author = %s\n", author.c_str());
			if (default_title == false && title == "")
				default_title == true;
			printf("title = %s\n", title.c_str());
		}
		else if (strcmp(temp+4, "TAG") == 0)
		{
			author = "";
			title = "";

			//Parse file info
			audiofile.seekg(124, ios_base::end);
			audiofile.readsome(temp, 30);
			temp[30]=0;
			title = temp;
			audiofile.seekg(94, ios_base::end);
			audiofile.readsome(temp, 30);
			temp[30]=0;
			author = temp;

			//Check for empty strings
			if (title != "")
				default_title = false;
			if (author != "")
				default_author = false;
		}

		//Reset shared variables
		temp[0] = 0;
	}
	//Close audiofile
	audiofile.close();

	//Add entry to channel
	xmlfile << "  <item>\n";
//	cout << "  <item>\n";

	//Check title strings for special characters
	if (default_title)
		replace_special(linktemp, audio.substr(0, length-4));
	else
		replace_special(linktemp, title);

	//Add title
	xmlfile << "   <title>" << linktemp << "</title>\n";
//	cout << "   <title>" << linktemp << "</title>\n";

	//Check file strings for special characters
	replace_special(linktemp, web_directory);
	link = linktemp;
	link += '/';
	replace_special(linktemp, audio);
	link += linktemp;

	//Add link
	xmlfile << "   <link>" << link << "</link>\n";
//	cout << "   <link>" << link << "</link>\n";

	//Add author if ID3 tag exists
	if (!default_author)
	{
		xmlfile << "   <author>" << author << "</author>\n";
//		cout << "   <author>" << author << "</author>\n";
	}

	//Add Date
	xmlfile << "   <pubDate>" << date << "</pubDate>\n";
//	cout << "   <pubDate>" << date << "</pubDate>\n";

	//Check file strings for spaces
	encode_url(linktemp, web_directory);
	link = linktemp;
	link += '/';
	encode_url(linktemp, audio);
	link += linktemp;

	//Add file
	xmlfile << "   <enclosure url=\"" << link << "\" type=\"";
//	cout << "   <enclosure url=\"" << link << "\" type=\"";

	//Add type
	if (extension == ".mp3")
	{
		xmlfile << "audio/mp3";
//		cout << "audio/mp3";
	}
	else if (extension == ".aac" || extension == ".mp4")
	{
		xmlfile << "audio/mp4";
//		cout << "audio/mp4";
	}

	//Finish item
	xmlfile << "\"/>\n";
//	cout << "\"/>\n";

	//Close entry
	xmlfile << "  </item>\n";
//	cout << "  </item>\n";
}

void close_xml_file(fstream& xmlfile)
{
	//Setup XML footer
	xmlfile << " </channel>\n";

	//Add rss close tag if none exists
	xmlfile.peek();
	if (xmlfile.eof())
	{
		//Clear eof bit
		xmlfile.clear();

		xmlfile << "</rss>";
	}

	//close xml file
	xmlfile.close();
}

//Set Date so it will remain constant throughout process
void set_date(string UTC_offset, string& date)
{
	char temp[1024];
	char * weekday[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
	char * month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
	tm *t_date;
	time_t rawtime;

	//Format Date
	//Get Timezone offset
	time(&rawtime);
	t_date = localtime(&rawtime);

	//Day of week
	date = weekday[t_date->tm_wday];
	date += ", ";

	//Day of Month
	sprintf(temp, "%d", t_date->tm_mday);
	date += temp;
	date += " ";

	//Month
	date += month[t_date->tm_mon];
	date += " ";

	//Year
	sprintf(temp, "%04d", t_date->tm_year + 1900);
	date += temp;
	date += " ";

	//Hour
	sprintf(temp, "%02d", t_date->tm_hour);
	date += temp;
	date += ":";

	//Minute
	sprintf(temp, "%02d", t_date->tm_min);
	date += temp;
	date += ":";

	//Second
	sprintf(temp, "%02d", t_date->tm_sec);
	date += temp;
	date += " ";

	//Timezone offset
	date += UTC_offset;
}

int main(int argc, char* argv[])
{
	fstream xmlfile;
	string xmlfilename, web_directory, local_directory, image="", audiolist, title, link="", description="", copyright="", UTC_offset="+0000", special, date;
	int error=0, i=1;

//Debug
//printf("line 285\n");
	//If not enough parameters, prompt for values
	if (strcmp(argv[i], "-U") == 0 || strcmp(argv[i], "-u") == 0)
	{
		system("cls");
		cout << "Output File Name (XML) ==>\n";
		getline (cin, xmlfilename);
		cout << "Web Directory (where files are stored online; no ending \"/\") ==>\n";
		getline (cin, web_directory);
		cout << "Local Directory (where files are stored locally; no ending \"/\") ==>\n";
		getline (cin, local_directory);
		cout << "Channel Title ==>\n";
		getline (cin, title);
		cout << "Time Zone Offset ([+-]hhmm format [i.e., -0600]) ==>\n";
		getline (cin, UTC_offset);
		cout << "Channel Hyper Link ==>\n";
		getline (cin, link);
		cout << "Channel Description ==>\n";
		getline (cin, description);
		cout << "Channel Copyright Information ==>\n";
		getline (cin, copyright);
		cout << "Channel Image File (displayed in channel list on PSP) ==>\n";
		getline (cin, image);
	}
	else if (argv[i][0] != '-' & argc > 1)
	{
		if (argc < 5)
		{
			cout << "Gimme a break here. I need input.\n\n";
			cout << "Unix/Linux:\n";
			cout << "Command prompt>PSP_RSS_feed [-U] <xml output file> <web file directory>\n";
			cout << "\t<local file directory> <channel title> <time zone offset>\n";
			cout << "\t[<channel link> [<channel description> [<channel copyright>\n";
			cout << "\t[<channel image filename>]]]]\n\n";
			cout << "DOS/Windows:\n";
			cout << "Command prompt>PSP_RSS_feed [-U] @inputfile\n";
			cout << "Where inputfile has one line containing:\n";
			cout << "\t<xml output file> <web file directory> <local file directory>\n";
			cout << "\t<channel title> <time zone offset>\n";
			cout << "\t[<channel link> [<channel description> [<channel copyright>\n";
			cout << "\t[<channel image filename>]]]]\n\n";
			cout << "Output will set xml links to \n";
			cout << "\t\"<web file directory>/each audio file in<local file directory>\"\n";
			cout << "If specified, output will set image link to \n";
			cout << "\t\"<web file directory>/<channel image filename>\"\n";
			cout << "\tOtherwise the image link will be set to the first image found.\n";
			cout << "The time zone offset is in [+-]hhmm format (i.e., -0600)\n";
			cout << "\nFor a User Input Prompt, add -U as the only parameter.\n";
			return 1;
		}
		else
		{
			//Scan command line for tags
			xmlfilename = argv[i++];
			web_directory = argv[i++];
			local_directory = argv[i++];
			title = argv[i++];
			if (argc >= 5)
				UTC_offset = argv[i++];
			if (argc >= 6)
				link = argv[i++];
			if (argc >= 7)
				description = argv[i++];
			if (argc >= 8)
				copyright = argv[i++];

			//Check for image file
			if (argc == 9)
				image = argv[i];
		}
	}
	else
	{
		while (i < argc)
		{
			if (strcmp(argv[i], "-L") == 0 || strcmp(argv[i], "-l") == 0)
			{
				i++;
				local_directory = argv[i++];
			}
			else if (strcmp(argv[i], "-O") == 0 || strcmp(argv[i], "-o") == 0)
			{
				i++;
				xmlfilename = argv[i++];
			}
			else if (strcmp(argv[i], "-W") == 0 || strcmp(argv[i], "-w") == 0)
			{
				i++;
				web_directory = argv[i++];
			}
			else if (strcmp(argv[i], "-T") == 0 || strcmp(argv[i], "-t") == 0)
			{
				i++;
				title = argv[i++];
			}
			else if (strcmp(argv[i], "-Z") == 0 || strcmp(argv[i], "-z") == 0)
			{
				i++;
				UTC_offset = argv[i++];
			}
			else if (strcmp(argv[i], "-C") == 0 || strcmp(argv[i], "-c") == 0)
			{
				i++;
				link = argv[i++];
			}
			else if (strcmp(argv[i], "-D") == 0 || strcmp(argv[i], "-d") == 0)
			{
				i++;
				description = argv[i++];
			}
			else if (strcmp(argv[i], "-R") == 0 || strcmp(argv[i], "-r") == 0)
			{
				i++;
				copyright = argv[i++];
			}
			else if (strcmp(argv[i], "-I") == 0 || strcmp(argv[i], "-i") == 0)
			{
				i++;
				image = argv[i++];
			}
			else
			{
				cout << "Incorrect parameter " << argv[i] << ". Ignoring.\n";
			}
		}
	}

	//Check for required input
	if (xmlfilename == "" || web_directory == "" || local_directory == "" || title == "")
	{
		cout << "Gimme a break here. I need input.\n\n";
		cout << "Unix/Linux:\n";
		cout << "Command prompt>PSP_RSS_feed [-U] -O <xml output file> -W <web file directory>\n";
		cout << "\t-L <local file directory> -T <channel title>\n";
		cout << "\t[-Z <time zone offset>] [-C <channel link>] [-D <channel description>]\n";
		cout << "\t[-R <channel copyright>] [-I <channel image filename>]\n\n";
		cout << "DOS/Windows:\n";
		cout << "Command prompt>PSP_RSS_feed [-U] @inputfile\n";
		cout << "Where inputfile has one line containing:\n";
		cout << "\t-O <xml output file> -W <web file directory>\n";
		cout << "\t-L <local file directory> -T <channel title>\n";
		cout << "\t[-Z <time zone offset>] [-C <channel link>] [-D <channel description>]\n";
		cout << "\t[-R <channel copyright>] [-I <channel image filename>]\n\n";
		cout << "Output will set xml links to \n";
		cout << "\t\"<web file directory>/each audio file in<local file directory>\"\n";
		cout << "If specified, output will set image link to \n";
		cout << "\t\"<web file directory>/<channel image filename>\"\n";
		cout << "\tOtherwise the image link will be set to the first image found.\n";
		cout << "The time zone offset is in [+-]hhmm format (i.e., -0600)\n";
		cout << "\nFor a User Input Prompt, add -U as the only parameter.\n";
		return 1;
	}

	//Check for image file
	if (image == "")
		get_image(local_directory, image);

//TODO: Add sanity checks to input

	//Search directory for files
	get_audiolist(local_directory, audiolist);

	//Replace Special Characters
	replace_special(special, web_directory);
	web_directory = special;
	replace_special(special, title);
	title = special;
	replace_special(special, link);
	link = special;
	replace_special(special, description);
	description = special;
	replace_special(special, copyright);
	copyright = special;
	replace_special(special, image);
	image = special;

	//Create xml file
	error = create_xml_file(xmlfile, xmlfilename, web_directory, image, title, link, description, copyright);
	if (error == 1)
	{
		return 1;
	}

	//Set Date
	set_date(UTC_offset, date);

	//Add values to xml file
	while(audiolist.length() > 6)
		add_audiofile(xmlfile, audiolist, local_directory, web_directory, date);

	//close xml file
	close_xml_file(xmlfile);

	return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产91精品免费| 日韩美一区二区三区| 久久久精品影视| 寂寞少妇一区二区三区| 日韩一二三区视频| 裸体歌舞表演一区二区| 欧美zozozo| 粉嫩13p一区二区三区| 午夜精品福利久久久| 欧美一三区三区四区免费在线看| 日韩高清不卡一区二区三区| 日韩欧美国产电影| 色视频一区二区| 午夜精品福利久久久| 亚洲柠檬福利资源导航| 欧美在线观看18| 美女视频黄a大片欧美| 国产女主播在线一区二区| 97超碰欧美中文字幕| 亚洲成人av电影在线| 欧美精品一区二区三区久久久| 成人精品高清在线| 午夜电影网一区| 一区二区三区四区高清精品免费观看 | 91免费视频网址| 日韩专区欧美专区| 亚洲国产高清aⅴ视频| 欧美日韩亚洲综合| 国产99久久精品| 国产又黄又大久久| 亚洲综合视频在线| 国产亚洲欧美中文| 欧美日韩一级片在线观看| 色天天综合久久久久综合片| 972aa.com艺术欧美| 不卡区在线中文字幕| 成人午夜碰碰视频| 高清国产午夜精品久久久久久| 美女精品一区二区| 久久精品国产999大香线蕉| 日韩在线播放一区二区| 丝袜美腿亚洲一区二区图片| 午夜精品视频在线观看| 肉肉av福利一精品导航| 亚洲v日本v欧美v久久精品| 亚洲一区二区三区激情| 亚洲成人av一区| 三级欧美在线一区| 青青草97国产精品免费观看无弹窗版| 国产精品天美传媒| 欧美成人国产一区二区| 精品处破学生在线二十三| 精品理论电影在线| 国产女人18水真多18精品一级做| 亚洲国产经典视频| 一区二区三区蜜桃网| 亚洲超碰精品一区二区| 久久99精品久久只有精品| 国产激情视频一区二区在线观看| 日本不卡在线视频| 黄色资源网久久资源365| 日本不卡一区二区三区高清视频| 精油按摩中文字幕久久| 国产v日产∨综合v精品视频| 成人av网址在线| 欧美视频中文字幕| 色婷婷av一区| 91精品久久久久久蜜臀| 欧洲另类一二三四区| 欧美高清一级片在线| 欧美三级日本三级少妇99| 日韩一区二区三区精品视频| 国产人伦精品一区二区| 亚洲女同ⅹxx女同tv| 蜜桃一区二区三区在线| 成人网在线免费视频| 欧美午夜精品久久久| 久久亚洲精华国产精华液 | 国产片一区二区| 亚洲欧美国产毛片在线| 丝袜国产日韩另类美女| 国产伦精品一区二区三区免费 | 欧美精品 日韩| 久久九九影视网| 亚洲午夜久久久久久久久电影院 | 亚洲欧美一区二区三区孕妇| 午夜欧美在线一二页| 国产大陆亚洲精品国产| 欧美日韩一区二区不卡| 国产视频亚洲色图| 亚洲成av人片在线| 成人三级伦理片| 91精品国产乱| 亚洲日本va午夜在线影院| 亚洲乱码中文字幕| 亚洲国产裸拍裸体视频在线观看乱了| 久久不见久久见免费视频1| 91看片淫黄大片一级| 亚洲精品一区二区在线观看| 伊人婷婷欧美激情| 国产黄色精品网站| 日韩一区二区免费视频| 亚洲精品你懂的| 成人免费福利片| 日韩精品一区二区在线| 亚洲二区在线视频| av网站免费线看精品| 欧美网站一区二区| 国产精品欧美一级免费| 激情文学综合网| 欧美一区午夜精品| 亚洲成人三级小说| 色综合色综合色综合| 欧美经典一区二区三区| 久久精品国产亚洲高清剧情介绍| 欧美视频中文一区二区三区在线观看| 国产欧美一区二区在线| 精品一区二区国语对白| 欧美一区二区三区四区久久| 国产电影一区二区三区| 亚洲精品一区二区精华| 日本不卡视频一二三区| 欧美精品视频www在线观看| 亚洲午夜一区二区三区| 色婷婷国产精品综合在线观看| 中文字幕制服丝袜一区二区三区 | 精品va天堂亚洲国产| 日本午夜一本久久久综合| 欧美三级电影网站| 亚洲一区二区三区四区中文字幕| 一本大道av伊人久久综合| 1000部国产精品成人观看| 免费在线观看视频一区| 777奇米成人网| 日韩和的一区二区| 4438x亚洲最大成人网| 日韩不卡一二三区| 日韩三级电影网址| 韩日欧美一区二区三区| 2017欧美狠狠色| 国产精品一区二区91| 欧美一区二区三区视频在线观看| 日韩精品乱码av一区二区| 欧美一区二区免费视频| 男女性色大片免费观看一区二区| 7777精品伊人久久久大香线蕉超级流畅| 亚洲韩国精品一区| 欧美日韩免费一区二区三区视频| 日韩中文字幕1| 欧美大黄免费观看| 国产v综合v亚洲欧| 亚洲乱码国产乱码精品精的特点 | 3d动漫精品啪啪| 另类人妖一区二区av| 久久久一区二区三区捆绑**| 丁香六月久久综合狠狠色| 1024亚洲合集| 欧美日韩国产小视频在线观看| 亚洲欧美综合另类在线卡通| 色综合婷婷久久| 中文在线一区二区| 色激情天天射综合网| 国产精品三级av| 欧美中文字幕一区| 奇米一区二区三区| 国产欧美一区二区精品仙草咪| www.性欧美| 视频一区二区中文字幕| 久久综合中文字幕| 99视频热这里只有精品免费| 亚洲午夜久久久久久久久久久| 欧美电影免费观看完整版| 成人美女视频在线看| 亚洲伊人色欲综合网| 亚洲精品一区二区三区精华液| a级精品国产片在线观看| 午夜欧美视频在线观看| 久久精品夜色噜噜亚洲aⅴ| 91极品视觉盛宴| 欧美日韩午夜精品| 韩国精品久久久| 亚洲三级免费电影| 日韩一区二区高清| 99精品国产99久久久久久白柏| 日韩电影免费在线| 专区另类欧美日韩| 精品国产一区二区三区四区四| 色综合久久精品| 国产伦精品一区二区三区视频青涩| 亚洲免费资源在线播放| 久久日韩精品一区二区五区| 在线观看一区不卡| 国产成人精品免费视频网站| 亚洲国产美国国产综合一区二区| 久久精品无码一区二区三区| 欧美日韩一区国产| 99久久久久久| 国产一区在线不卡| 亚洲6080在线| 亚洲精品中文在线|