aboutsummaryrefslogtreecommitdiff
path: root/include/NetUtils.hpp
blob: bacafc7be9bad3c496359c8cc3a08a94ed10ed1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once

#include <string>
#include <vector>

namespace QuickMedia {
    struct Range {
        size_t start;
        size_t length;
    };

    void html_escape_sequences(std::string &str);
    void html_unescape_sequences(std::string &str);
    std::string url_param_encode(const std::string &param);
    std::vector<Range> extract_urls(const std::string &str);
    std::vector<std::string> ranges_get_strings(const std::string &str, const std::vector<Range> &ranges);
    void convert_utf8_to_utf32_ranges(const std::string &str, std::vector<Range> &ranges);
    std::string header_extract_value(const std::string &header, const std::string &type);
}