-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHTMLParser.h
More file actions
45 lines (33 loc) · 973 Bytes
/
HTMLParser.h
File metadata and controls
45 lines (33 loc) · 973 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
43
44
45
/*
SimpleSearch
author: Sam Chippas
email: [email protected]
Copyright (c) 2019
All Rights Reserved
*/
#ifndef SIMPLESEARCH_HTMLPARSER_H_
#define SIMPLESEARCH_HTMLPARSER_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
class HTMLParser{
public:
//Credentials for the MySQL database
//Change as needed.
const char *mysql_address = "127.0.0.1";
const char *mysql_user = "root";
const char *mysql_pass = NULL;
const char *mysql_schema = "SimpleSearch";
int mysql_port = 3306;
//Parses HTML data to be inserted into the database.
void parse(char *buffer, int size, int count);
//Function to compare text.
int cmp(char **buf, const char *m);
//Stores a website's title
virtual void onTitleFound(char *title, int count);
//Parses and stores a website's data
virtual void onContentFound(char *desc, int count);
//Parses and stores new urls
virtual void onAnchorFound(char *url);
};
#endif //SIMPLESEARCH_HTMLPARSER_H_