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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? psp_rss_feed.cpp

?? PSP_RSS_feed-2.0-src.zip這是使用C++實(shí)現(xiàn)的RSS FEED想學(xué)的下載,不錯(cuò)
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*(c) 2006 Christopher James Meacham (alias Optimus[ Prime])
*
*Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
*
*DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
*
*[2004, Fair License: rhid.com/fair]
*/

#include <time.h>
#include <stdio.h>
#include <stdlib.h> //Standard C Strings
#include <iostream>
#include <fstream>
#include <dirent.h> //Directory scanning
#include <errno.h>

//There are no symbolic links in Windows so ELOOP will be undefined
#ifndef ELOOP
const int ELOOP=0;
#endif

using namespace std;

//Encode for URL
void encode_url(string& output, string input)
{
	int pos;
	string temp=input, replace_output, replace_temp;
	unsigned char i;
	char j[3]="";

	output = input;

	i = 0x25;
	while (temp.find(i) != string::npos)
	{
		//find space
		pos = temp.find(i);
		//and replace
		sprintf(j, "%02X", i);
		replace_temp = "0";
		replace_temp += j;
		temp.replace(pos, 1, replace_temp);
		replace_output = "%";
		replace_output += j;
		output.replace(pos, 1, replace_output);
	}
	for (i = 0x20; i < 0x25; i++)
	{
		while (temp.find(i) != string::npos)
		{
			//find space
			pos = temp.find(i);
			//and replace
			sprintf(j, "%02X", i);
			replace_temp = "0";
			replace_temp += j;
			temp.replace(pos, 1, replace_temp);
			replace_output = "%";
			replace_output += j;
			output.replace(pos, 1, replace_output);
		}
	}
	for (i = 0x26; i < 0x2D; i++)
	{
		while (temp.find(i) != string::npos)
		{
			//find space
			pos = temp.find(i);
			//and replace
			sprintf(j, "%02X", i);
			replace_temp = "0";
			replace_temp += j;
			temp.replace(pos, 1, replace_temp);
			replace_output = "%";
			replace_output += j;
			output.replace(pos, 1, replace_output);
		}
	}
	for (i = 0x3B; i < 0x41; i++)
	{
		while (temp.find(i) != string::npos)
		{
			//find space
			pos = temp.find(i);
			//and replace
			sprintf(j, "%02X", i);
			replace_temp = "0";
			replace_temp += j;
			temp.replace(pos, 1, replace_temp);
			replace_output = "%";
			replace_output += j;
			output.replace(pos, 1, replace_output);
		}
	}
	for (i = 0x5B; i < 0x61; i++)
	{
		while (temp.find(i) != string::npos)
		{
			//find space
			pos = temp.find(i);
			//and replace
			sprintf(j, "%02X", i);
			replace_temp = "0";
			replace_temp += j;
			temp.replace(pos, 1, replace_temp);
			replace_output = "%";
			replace_output += j;
			output.replace(pos, 1, replace_output);
		}
	}
	for (i = 0x7B; i <= 0x7F; i++)
	{
		while (temp.find(i) != string::npos)
		{
			//find space
			pos = temp.find(i);
			//and replace
			sprintf(j, "%02X", i);
			replace_temp = "0";
			replace_temp += j;
			temp.replace(pos, 1, replace_temp);
			replace_output = "%";
			replace_output += j;
			output.replace(pos, 1, replace_output);
		}
	}
}

//Check strings for special characters
void replace_special(string& output, string input)
{
	int pos;
	string temp=input;

	output = input;

	while (temp.find('&') != string::npos)
	{
		//find space
		pos = temp.find('&');
		//and replace
		temp.replace(pos, 1, "space");
		output.replace(pos, 1, "&amp;");
	}
	while (output.find('<') != string::npos)
	{
		//find space
		pos = output.find('<');
		//and replace
		output.replace(pos, 1, "&lt;");
	}
	while (output.find('>') != string::npos)
	{
		//find space
		pos = output.find('>');
		//and replace
		output.replace(pos, 1, "&gt;");
	}
	while (output.find('\'') != string::npos)
	{
		//find space
		pos = output.find('\'');
		//and replace
		output.replace(pos, 1, "&apos;");
	}
	while (output.find('\"') != string::npos)
	{
		//find space
		pos = output.find('\"');
		//and replace
		output.replace(pos, 1, "&quot;");
	}
}

//Check strings for spaces
//Deprecated
//void replace_spaces(string& output, string input)
//{
//	int pos;
//
//	replace_special(output, input);
//
//	while (output.find(' ') != string::npos)
//	{
//		//find space
//		pos = output.find(' ');
//		//and replace
//		output.replace(pos, 1, "%20");
//	}
//}

//Search local directory for audio files
void get_audiolist(string directory, string& audiolist)
{
	DIR *directory_pointer;
	dirent *file;
	int length=0;
	char error[3]="0";

	//Clear audiolist
	audiolist = "";

	//Set Directory
	directory_pointer = opendir(directory.c_str());
	
	//Catch error
	if (directory_pointer == NULL)
	{
		cout << "\nError accessing the directory:\n\tError #";
		sprintf(error, "%d", errno);
		cout << error;
		cout << " = ";
		switch (errno)
		{
			case EACCES:		cout << "Search permission is denied for a component of the path prefix\n";
						cout << "\t\tof directory or read permission is denied for directory.\n";
						break;
			case ELOOP:		cout << "Too many symbolic links were encountered in resolving the path.\n";
						break;
			case ENAMETOOLONG:	cout << "The length of the directory name exceeds {PATH_MAX}, a pathname\n";
						cout << "\t\tcomponent is longer than {NAME_MAX}, or pathname resolution of\n";
						cout << "\t\ta symbolic link produced an intermediate result whose length\n";
						cout << "\t\texceeds {PATH_MAX}.\n";
						break;
			case ENOENT:		cout << "A component of the path does not name an existing directory or\n";
						cout << "\t\ta directory name was not given.\n";
						break;
			case ENOTDIR:		cout << "A component of the path is not a directory.\n";
						break;
			case EMFILE:		cout << "The maximum number of file descriptors are currently open in the\n";
						cout << "\t\tcalling process.\n";
						break;
			case ENFILE:		cout << "Too many files are currently open in the system.\n";
						break;
			default:		cout << "Unknown Error\n";
						break;
		}
	}

	//Compose audio file list
	while ((file = readdir(directory_pointer)) != NULL)
	{
		//Check file extension
		string temp = file->d_name, temp2;

		length = temp.length();
		if (length > 4)
		{
			temp2 = temp.substr(length-4, 4);
			if (temp2 == ".aac" || temp2 == ".mp3" || temp2 == ".mp4")
			{
				audiolist += temp;
				audiolist += "/";
			}
		}
	}
	closedir(directory_pointer);
//Debug
//printf("audiolist ==>%s\n", audiolist.c_str());
}

//Search web directory for image files and prompt if more than one found
void get_image(string directory, string& image)
{
	DIR *directory_pointer;
	dirent *file;
	int length=0;
	char error[3]="0";

	//Set Directory
	directory_pointer = opendir(directory.c_str());

	//Catch error
	if (directory_pointer == NULL)
	{
		cout << "\nError accessing the directory:\n\tError #";
		sprintf(error, "%d", errno);
		cout << error;
		cout << " = ";
		switch (errno)
		{
			case EACCES:		cout << "Search permission is denied for a component of the path prefix\n";
						cout << "\t\tof directory or read permission is denied for directory.\n";
						break;
			case ELOOP:		cout << "Too many symbolic links were encountered in resolving the path.\n";
						break;
			case ENAMETOOLONG:	cout << "The length of the directory name exceeds {PATH_MAX}, a pathname\n";
						cout << "\t\tcomponent is longer than {NAME_MAX}, or pathname resolution of\n";
						cout << "\t\ta symbolic link produced an intermediate result whose length\n";
						cout << "\t\texceeds {PATH_MAX}.\n";
						break;
			case ENOENT:		cout << "A component of the path does not name an existing directory or\n";
						cout << "\t\ta directory name was not given.\n";
						break;
			case ENOTDIR:		cout << "A component of the path is not a directory.\n";
						break;
			case EMFILE:		cout << "The maximum number of file descriptors are currently open in the\n";
						cout << "\t\tcalling process.\n";
						break;
			case ENFILE:		cout << "Too many files are currently open in the system.\n";
						break;
			default:		cout << "Unknown Error\n";
						break;
		}
	}

	//Get image filename
	while ((file = readdir(directory_pointer)) != NULL)
	{
		//Check file extension
		string temp = file->d_name, temp2;

		length = temp.length();
		if (length > 4)
		{
			temp2 = temp.substr(length-4, 4);
			if (temp2 == ".gif" || temp2 == ".jpg" || temp2 == ".tif" || temp2 == ".png")
			{
				image = temp;
				closedir(directory_pointer);
				return;
			}
		}
	}
	closedir(directory_pointer);
}

int create_xml_file(fstream& xmlfile, string xmlfilename, string directory, string image, string title, string link, string description, string copyright)
{
	FILE *file;
	string temp, image_link="";
	char temp2[1024];

	if (image != "")
	{
		//Check file strings for spaces
		encode_url(temp, directory);
		image_link = temp;
		image_link += '/';
		encode_url(temp, image);
		image_link += temp;
		temp="";
	}

	//Create xml file and setup XML header.
	file = fopen(xmlfilename.c_str(), "a");
	fclose(file);
	xmlfile.open(xmlfilename.c_str(), fstream::in|fstream::out);
	if (!xmlfile.is_open())
	{
		cout << "Error opening xml file:" << xmlfilename << ".\n";
		return 1;
	}

	//If file already exists, seek past header.
	xmlfile.peek();
	if (xmlfile.eof())
	{
		//Clear eof bit
		xmlfile.clear();
//Debug
//printf("line 113");
		//create header
		xmlfile << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
		xmlfile << "<rss version=\"2.0\">\n";
		xmlfile << " <channel>\n";
		xmlfile << "  <title>" << title << "</title>\n";
		if (link != "")
		{
			xmlfile << "  <link>" << link << "</link>\n";
		}
		if (description != "")
		{
			xmlfile << "  <description>" << description << "</description>\n";
		}
		xmlfile << "  <language>en-us</language>\n";
		if (copyright != "")
		{
			xmlfile << "  <copyright>" << copyright << "</copyright>\n";
		}

		if (image_link != "")
		{
			xmlfile << "  <image>\n";
			xmlfile << "   <url>" << image_link << "</url>\n";
			xmlfile << "   <title>" << title << "</title>\n";
			xmlfile << "  </image>\n";
		}

	}
	else
	{
//Debug
//printf("line 132\n");
		//seek past header and any previously created channels
		while (1)
		{
			xmlfile.getline(temp2, 1024);
			temp = temp2;
			if (temp.find("</channel>") != string::npos)
			{
				xmlfile.getline(temp2, 1024);
				temp = temp2;
//Debug
//printf("line 147\n");
				if (temp.find("<channel>") == string::npos)
				{
					int place, count;

					//Clear error flags
					if (xmlfile.eof())
						xmlfile.clear();

					//Do the math
					place=xmlfile.tellg();
					count=xmlfile.gcount();
					xmlfile.seekg(place-count);
					xmlfile.seekp(place-count);
//Debug
//printf("line 154\n");
//printf("place=%d\ncount=%d\nxmlfile.tellg()=%d\nxmlfile.tellp()=%d\n", place, count, (int)xmlfile.tellg(), (int)xmlfile.tellp());
					break;
				}
			}
			if (xmlfile.eof())
			{
				cout << "Error in original XML file. No channel close tag (i.e., \"</channel>\").\n";
				return 1;
			}
		}

//Debug
//printf("line 166\n");
		//Add channel header
		xmlfile << " <channel>\n";
		xmlfile << "  <title>" << title << "</title>\n";
		if (link != "")
		{
			xmlfile << "  <link>" << link << "</link>\n";
		}
		if (description != "")
		{
			xmlfile << "  <description>" << description << "</description>\n";
		}
		xmlfile << "  <language>en-us</language>\n";
		if (copyright != "")
		{
			xmlfile << "  <copyright>" << copyright << "</copyright>\n";
		}

		if (image_link != "")
		{
			xmlfile << "  <image>\n";
			xmlfile << "   <url>" << image_link << "</url>\n";
			xmlfile << "   <title>" << title << "</title>\n";
			xmlfile << "  </image>\n";
		}
	}

	return 0;
}

//length is equal to the total number of characters in the buffer
//(i.e., 0-1023 signifies 1024 characters)
//Debug ==> Untested
void remove_nulls(char text[], int length)
{
	int modified_length=length, i, j;

	for (i=0; i<modified_length; i++)
	{
		//If current character is null, remove
		if (text[i] == 0)
		{
			modified_length--;
			for (j=i+1; j<length; j++)
				text[j-1] = text[j];
			text[length-1]=0;
		}
	}
}

void add_audiofile(fstream& xmlfile, string& audiolist, string local_directory, string web_directory, string date)
{
	bool default_title = true, default_author = true;
	string audio, extension, link, linktemp, title, author;
	char temp[1024];
	fstream audiofile;
	int length=0;

	//Get audio file name
	length = audiolist.find('/');
	audio = audiolist.substr(0, length);

	//Remove audio file from list
	audiolist.replace(0, length+1, "");

	//Check for compatibility
	extension = audio.substr(length-4, 4);
//Debug
//printf("Current file ==>%s\nextension ==>%s\naudiolist ==>%s\n", audio.c_str(), extension.c_str(), audiolist.c_str());
	if (extension != ".mp3" && extension != ".aac" && extension != ".mp4")
	{
		cout << "A format that is unsupported by 2.60 firmware has been scanned into audiolist somehow.\n";
		return;
	}

	//Open audio file to parse info
	audiofile.open((local_directory + "\\" + audio).c_str(), fstream::in | ios_base::binary);
	if (!audiofile.is_open())
	{
		cout << "Error opening" << audio << ".\n";
		cout << "Using defaults.\n";
	}
	else if (extension == ".mp3")
	{
		//Check for ID3v2 tag
		audiofile.readsome(temp, 3);
		temp[3] = 0;

		//Check for ID3v1 tag
		audiofile.seekg(127, ios_base::end);
		audiofile.readsome(temp+4, 3);
		temp[7] = 0;
//Debug
//printf("\nID3v2 = %s\nID3v1 = %s\n", temp, temp+4);

		if (strcmp(temp, "ID3") == 0)
		{
			string temp2;
			int id3_length=0, frame_length=0, i=0, cursor=0;

			//Get id3 length
			//ID3 Header is 3 characters (ID3),
			//2 bytes for version number,
			//1 byte for flags,
			//and 4 bytes for size
			//	(Size is 28-bit integer composed of
			//	 the last 7 bits of each byte, most
			//	 significant first. It does not
			//	 include the 10 byte ID3 header.)
			audiofile.seekg(cursor);
			audiofile.readsome(temp, 10);
			cursor += 10;
			i=6;
			id3_length = 10;
			//Most Significant byte * 128^3
			id3_length += temp[i++]*2097152;
			//Next to Most Significant byte * 128^2
			id3_length += temp[i++]*16384;
			//Next Least Significant byte * 128
			id3_length += temp[i++]*128;
			//Least Significant byte
			id3_length += temp[i++];
			temp[0] = 0;
			author = "";
			title = "";
//Debug
printf("\nFile = %s\nid3_length = %X\n", audio.c_str(), id3_length);

			//Parse file info
			while (cursor < id3_length)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色欧美日韩亚洲| 亚洲欧洲www| 欧美一区二区三区影视| 欧美日韩一级二级| 中文无字幕一区二区三区 | 欧美色综合久久| 色天天综合久久久久综合片| 99久久国产免费看| 91蜜桃在线观看| 91久久奴性调教| 在线观看日韩国产| 欧美日韩情趣电影| 制服丝袜av成人在线看| 91精品中文字幕一区二区三区| 欧美日韩中文字幕一区二区| 欧美日韩成人激情| 日韩一卡二卡三卡四卡| 欧美videos中文字幕| 精品日韩在线观看| 国产校园另类小说区| 国产人妖乱国产精品人妖| 亚洲国产精品精华液ab| 国产精品成人一区二区艾草| 亚洲男同1069视频| 亚洲成人中文在线| 久久精品国产一区二区| 国产精品一二三区| 不卡av免费在线观看| 91视视频在线直接观看在线看网页在线看| 91免费观看国产| 欧美日韩视频在线第一区| 欧美成人video| 国产免费成人在线视频| 亚洲精品美国一| 丝袜美腿高跟呻吟高潮一区| 久久99久久99精品免视看婷婷| 国产精品一区二区视频| 91毛片在线观看| 91麻豆精品国产| 久久精品在这里| 一区二区欧美精品| 麻豆精品一区二区综合av| 丁香六月综合激情| 欧美日韩一区精品| 国产日韩欧美精品电影三级在线| 亚洲人成网站精品片在线观看| 天堂一区二区在线| 国产成人超碰人人澡人人澡| 91麻豆国产香蕉久久精品| 欧美精品欧美精品系列| 国产三级欧美三级日产三级99 | 国产午夜精品理论片a级大结局| 中文字幕一区三区| 日韩国产欧美一区二区三区| 大尺度一区二区| 555夜色666亚洲国产免| 亚洲国产精品精华液ab| 日韩高清中文字幕一区| 国产福利电影一区二区三区| 欧美系列一区二区| 国产拍揄自揄精品视频麻豆| 舔着乳尖日韩一区| 成人免费毛片片v| 欧美日韩亚洲丝袜制服| 国产精品午夜免费| 免费看精品久久片| 色婷婷亚洲精品| 日本 国产 欧美色综合| a在线欧美一区| 欧美大胆一级视频| 亚洲一区二区三区视频在线播放| 国产精品影视在线| 日韩一级二级三级| 亚洲成人综合视频| 色综合久久久久| 国产三级精品三级在线专区| 蜜臀va亚洲va欧美va天堂| 在线日韩av片| 亚洲欧洲三级电影| 国产成人自拍网| 日韩欧美国产电影| 亚洲a一区二区| 色综合一区二区三区| 国产调教视频一区| 久久99日本精品| 69av一区二区三区| 亚洲国产精品久久久久秋霞影院| 97久久精品人人做人人爽50路 | 亚洲欧美一区二区视频| 国产激情视频一区二区三区欧美| 91精品国产一区二区| 亚洲一二三专区| 色噜噜狠狠成人中文综合| 国产精品美女久久久久aⅴ| 国产一区二区在线视频| 欧美成人综合网站| 青青草国产成人av片免费| 欧美在线观看一区| 一区2区3区在线看| 91黄视频在线| 亚洲狠狠丁香婷婷综合久久久| jlzzjlzz欧美大全| 国产精品不卡在线| av爱爱亚洲一区| 国产精品毛片大码女人| 成人午夜免费电影| 中文字幕精品一区二区三区精品| 国产成人在线视频网址| 久久精品在线免费观看| 国产91富婆露脸刺激对白| 久久久久久久久久看片| 国产成人免费在线观看不卡| 国产午夜亚洲精品羞羞网站| 国产美女精品在线| 欧美激情综合网| 不卡一区在线观看| 综合欧美亚洲日本| 日本久久电影网| 亚洲国产精品一区二区www在线| 欧美中文字幕一二三区视频| 亚洲aaa精品| 日韩视频在线永久播放| 国产主播一区二区三区| 国产精品午夜免费| 色综合久久综合网欧美综合网| 亚洲一区二区三区中文字幕 | 欧美色综合天天久久综合精品| 亚洲福利视频一区| 91精品国产入口| 国产一区免费电影| 一区在线播放视频| 欧美日韩一卡二卡三卡| 蜜乳av一区二区| 国产日韩欧美精品在线| 色综合视频在线观看| 亚洲va国产va欧美va观看| 日韩欧美一区电影| 精品久久久久av影院| 国产精品一区二区久久精品爱涩| 亚洲欧洲国产日韩| 欧美日韩国产小视频| 免费成人你懂的| 国产欧美视频一区二区三区| 色诱视频网站一区| 蜜臀av国产精品久久久久| 国产三级欧美三级| 在线观看日韩电影| 在线播放视频一区| 久久精品日产第一区二区三区高清版 | 日韩国产欧美在线播放| 亚洲视频免费在线| 午夜精品久久久久久久99水蜜桃| 日韩vs国产vs欧美| 久久99精品国产麻豆婷婷| 91在线视频网址| 欧美mv日韩mv| 欧美综合色免费| 日韩电影在线免费| 国产精品精品国产色婷婷| 欧美日韩一二三区| 国产伦精一区二区三区| 一区二区在线免费| 亚洲精品一区二区三区影院 | 欧美亚洲另类激情小说| 国模无码大尺度一区二区三区| 亚洲欧美视频一区| 精品国产免费视频| 欧美午夜影院一区| 国产成人午夜视频| 日本欧美在线观看| 亚洲欧洲另类国产综合| 精品捆绑美女sm三区| 色一情一乱一乱一91av| 国产美女精品一区二区三区| 亚洲高清不卡在线观看| 中文字幕欧美激情| 综合久久给合久久狠狠狠97色 | 欧美一区二区三区爱爱| 99精品欧美一区二区三区小说 | 高清日韩电视剧大全免费| 日韩—二三区免费观看av| 亚洲免费在线电影| 欧美国产丝袜视频| 日韩一级片网址| 欧美日韩高清不卡| 一本久久a久久免费精品不卡| 国产酒店精品激情| 蜜臀久久99精品久久久画质超高清 | 91日韩精品一区| 国产在线播放一区| 免费观看成人鲁鲁鲁鲁鲁视频| 尤物视频一区二区| 国产精品区一区二区三| 久久亚洲免费视频| 欧美一区二区国产| 欧美高清精品3d| 欧美挠脚心视频网站| 精品视频一区二区三区免费| 色综合一区二区| 91麻豆精品在线观看|