-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurl.h
More file actions
42 lines (38 loc) · 665 Bytes
/
url.h
File metadata and controls
42 lines (38 loc) · 665 Bytes
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
32
33
34
35
36
37
38
39
40
41
42
#ifndef __URL_H__
#define __URL_H__
#include <stdio.h>
#include <set>
#include <queue>
#include <string>
#include <iostream>
#include <string.h>
using namespace std;
struct Url
{
string url;
int depth;
public:
Url(string murl,int mdepth):url(murl),depth(mdepth){}
};
class Curl
{
public:
set<string> s_url;
queue<Url > q_url;
public:
void push_url(char *url,int depth)
{
if(strncmp(url,"http://",7)==0)
{
string m_url(url);
if(s_url.find(m_url)==s_url.end())
{
printf("url=%s\n",url);
s_url.insert(m_url);
q_url.push(Url(m_url,depth));
printf("q_url.size=%d\n",q_url.size());
}
}
}
};
#endif