1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-12-28 15:38:48 +01:00

Adds lib-network-manager

This commit is contained in:
Dmitry Vedenko
2021-05-25 16:07:23 +03:00
parent 52a835bd61
commit 77cc7bed6f
22 changed files with 2249 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
/*!********************************************************************
Audacity: A Digital Audio Editor
@file CurlStringList.cpp
@brief Define a RAII wrapper for the curl_slist.
Dmitry Vedenko
**********************************************************************/
#include "CurlStringList.h"
#include <curl/curl.h>
namespace audacity
{
namespace network_manager
{
CurlStringList::CurlStringList (CurlStringList&& rhs) noexcept
: mList (rhs.mList)
{
rhs.mList = nullptr;
}
CurlStringList::~CurlStringList () noexcept
{
curl_slist_free_all (mList);
}
CurlStringList& CurlStringList::operator= (CurlStringList&& rhs) noexcept
{
std::swap (mList, rhs.mList);
return *this;
}
void CurlStringList::append (const std::string& string) noexcept
{
mList = curl_slist_append (mList, string.c_str ());
}
void CurlStringList::append (const char* string) noexcept
{
mList = curl_slist_append (mList, string);
}
curl_slist* CurlStringList::getCurlList () const noexcept
{
return mList;
}
}
}