Ring Daemon
16.0.0
Loading...
Searching...
No Matches
uri.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2025 Savoir-faire Linux Inc.
3
*
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <https://www.gnu.org/licenses/>.
16
*/
17
#pragma once
18
19
#include <string>
20
#include <string_view>
21
22
namespace
jami
{
23
24
using namespace
std::string_view_literals;
25
26
static
constexpr
std::string_view
DATA_TRANSFER_SCHEME
=
"data-transfer://"
sv
;
27
28
class
Uri
29
{
30
public
:
31
enum class
Scheme
{
32
JAMI
,
// Start with "jami:" and 45 ASCII chars OR 40 ASCII chars
33
SIP
,
// Start with "sip:"
34
SWARM
,
// Start with "swarm:" and 40 ASCII chars
35
RENDEZVOUS
,
// Start with "rdv" and used for call in swarms
36
GIT
,
// Start with "git:"
37
DATA_TRANSFER
,
// Start with "data-transfer://"
38
SYNC
,
// Start with "sync:"
39
MESSAGE
,
// Start with "msg:"
40
AUTH
,
// Start with "auth:"
41
UNRECOGNIZED
// Anything that doesn't fit in other categories
42
};
43
44
Uri
(std::string_view uri);
45
46
const
std::string&
authority
()
const
;
47
Scheme
scheme
()
const
;
48
std::string
toString
()
const
;
49
// TODO hostname, transport, handle sip:
50
51
private
:
52
constexpr
std::string_view schemeToString()
const
;
53
Scheme
scheme_;
54
std::string authority_;
55
};
56
}
// namespace jami
jami::Uri
Definition
uri.h:29
jami::Uri::authority
const std::string & authority() const
Definition
uri.cpp:63
jami::Uri::scheme
Scheme scheme() const
Definition
uri.cpp:69
jami::Uri::toString
std::string toString() const
Definition
uri.cpp:75
jami::Uri::Scheme
Scheme
Definition
uri.h:31
jami::Uri::Scheme::JAMI
@ JAMI
jami::Uri::Scheme::SYNC
@ SYNC
jami::Uri::Scheme::SWARM
@ SWARM
jami::Uri::Scheme::DATA_TRANSFER
@ DATA_TRANSFER
jami::Uri::Scheme::SIP
@ SIP
jami::Uri::Scheme::MESSAGE
@ MESSAGE
jami::Uri::Scheme::RENDEZVOUS
@ RENDEZVOUS
jami::Uri::Scheme::UNRECOGNIZED
@ UNRECOGNIZED
jami::Uri::Scheme::GIT
@ GIT
jami::Uri::Scheme::AUTH
@ AUTH
jami
Definition
account.cpp:61
jami::emitSignal
void emitSignal(Args... args)
Definition
ring_signal.h:64
jami::DATA_TRANSFER_SCHEME
static constexpr std::string_view DATA_TRANSFER_SCHEME
Definition
uri.h:26
src
uri.h
Generated on Thu Jun 19 2025 15:50:38 for Ring Daemon by
1.9.8