summaryrefslogtreecommitdiff
path: root/include/tgbot/net/Url.h
blob: 818cf692d9a5c6728d08c6055cc4810f173c2d26 (plain)
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
46
47
48
#ifndef TGBOT_CPP_URL_H
#define TGBOT_CPP_URL_H

#include "tgbot/export.h"

#include <string>

namespace TgBot {

/**
 * @brief This class parses a string with the url
 *
 * @ingroup net
 */
class TGBOT_API Url {

public:
    Url(const std::string& url);

    /**
     * @brief Protocol part of an url. Example: https://
     */
    std::string protocol;

    /**
     * @brief Host part of an url. Example: www.example.com
     */
    std::string host;

    /**
     * @brief Path part of an url including preceding '/' char. Example: /index.html
     */
    std::string path;

    /**
     * @brief Query part of an url without '?' char. Example: a=1&b=2&c=3
     */
    std::string query;

    /**
     * @brief Fragment part of an url without '#' char. Example: section1
     */
    std::string fragment;
};

}

#endif //TGBOT_CPP_URL_H