Files
transmission/libtransmission/api-compat.h
Charles Kerr 677e0a6335 test: add tests for RpcClient (#8137)
* refactor do not cache style in convert_outgoing_data() -- not testing-friendly

* refactor: pass a QNetworkAccessManager into RpcClient constructor

this way we can inject a fake one in tests

* refactor: add RpcClient tests

* refactor: remove pointless QVERIFY call

* refactor: add api_compat::default_style()

* refactor: add api_compat::set_default_style()

* test: parameterize RpcClient tests for Tr4 and Tr5
2026-01-14 13:52:10 -06:00

28 lines
706 B
C++

// This file Copyright © Mnemosyne LLC.
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.
#pragma once
#include <cstdint> // uint8_t
struct tr_variant;
namespace libtransmission::api_compat
{
enum class Style : uint8_t
{
Tr4, // bespoke RPC, mixed-case keys,
Tr5, // jsonrpc, all snake_case keys
};
void convert(tr_variant& var, Style tgt_style);
void convert_incoming_data(tr_variant& var);
void convert_outgoing_data(tr_variant& var);
[[nodiscard]] Style default_style();
void set_default_style(Style style);
} // namespace libtransmission::api_compat