Ring Daemon
Loading...
Searching...
No Matches
uri.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2004-2026 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 <cstdint>
20
#include <string>
21
#include <string_view>
22
23
namespace
jami
{
24
25
using namespace
std::string_view_literals;
26
27
static
constexpr
std::string_view
DATA_TRANSFER_SCHEME
=
"data-transfer://"
sv
;
28
29
class
Uri
30
{
31
public
:
32
enum class
Scheme
:
uint8_t
{
33
JAMI
,
// Start with "jami:" and 45 ASCII chars OR 40 ASCII chars
34
SIP
,
// Start with "sip:"
35
SWARM
,
// Start with "swarm:" and 40 ASCII chars
36
RENDEZVOUS
,
// Start with "rdv" and used for call in swarms
37
GIT
,
// Start with "git:"
38
DATA_TRANSFER
,
// Start with "data-transfer://"
39
SYNC
,
// Start with "sync:"
40
MESSAGE
,
// Start with "msg:"
41
AUTH
,
// Start with "auth:"
42
UNRECOGNIZED
// Anything that doesn't fit in other categories
43
};
44
45
Uri
(std::string_view uri);
46
47
const
std::string&
authority
()
const
;
48
Scheme
scheme
()
const
;
49
std::string
toString
()
const
;
50
// TODO hostname, transport, handle sip:
51
52
private
:
53
constexpr
std::string_view schemeToString()
const
;
54
Scheme
scheme_;
55
std::string authority_;
56
};
57
}
// namespace jami
jami::Uri
Definition
uri.h:30
jami::Uri::Scheme
Scheme
Definition
uri.h:32
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::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
Definition
account.cpp:56
jami::emitSignal
void emitSignal(Args... args)
Definition
jami_signal.h:64
jami::DATA_TRANSFER_SCHEME
static constexpr std::string_view DATA_TRANSFER_SCHEME
Definition
uri.h:27
src
uri.h
Generated on Fri Apr 3 2026 14:23:10 for Ring Daemon by
1.9.8