WinStd
Windows Win32 API using Standard C++
Loading...
Searching...
No Matches
WinHTTP.h
1/*
2 SPDX-License-Identifier: MIT
3 Copyright © 1991-2023 Amebis
4 Copyright © 2016 GÉANT
5*/
6
8
9#pragma once
10
11#include "Common.h"
12#include <winhttp.h>
13
14namespace winstd
15{
18
24 class http : public handle<HINTERNET, NULL>
25 {
26 WINSTD_HANDLE_IMPL(http, HINTERNET, NULL)
27
28 public:
34 virtual ~http()
35 {
36 if (m_h != invalid)
38 }
39
40 protected:
46 void free_internal() noexcept override
47 {
48 WinHttpCloseHandle(m_h);
49 }
50 };
51
53}
Base abstract template class to support generic object handle keeping.
Definition Common.h:1020
handle_type m_h
Object handle.
Definition Common.h:1274
HTTP handle wrapper class.
Definition WinHTTP.h:25
virtual ~http()
Closes a handle to the HTTP.
Definition WinHTTP.h:34
void free_internal() noexcept override
Closes a handle to the HTTP.
Definition WinHTTP.h:46
#define WINSTD_HANDLE_IMPL(C, T, INVAL)
Implements default constructors and operators to prevent their auto-generation by compiler.
Definition Common.h:164
static const HINTERNET invalid
Invalid handle value.
Definition Common.h:1030