OpenVPN 3 Core Library
Loading...
Searching...
No Matches
indexed_title.hpp
Go to the documentation of this file.
1
// OpenVPN -- An application to securely tunnel IP networks
2
// over a single port, with support for SSL/TLS-based
3
// session authentication and key exchange,
4
// packet encryption, packet authentication, and
5
// packet compression.
6
//
7
// Copyright (C) 2012- OpenVPN Inc.
8
//
9
// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10
//
11
12
#pragma once
13
14
#include <string>
15
16
#include <
openvpn/common/size.hpp
>
17
18
namespace
openvpn
{
19
20
// TITLE class for representing an object name and index.
21
// Useful for referring to array indices when generating errors.
22
class
IndexedTitle
23
{
24
public
:
25
IndexedTitle
(
const
char
*title,
const
size_t
index)
26
:
title_
(title),
27
index_
(index)
28
{
29
}
30
31
std::string
to_string
()
const
32
{
33
return
std::string(
title_
) +
'.'
+ std::to_string(
index_
);
34
}
35
36
bool
empty
()
const
37
{
38
return
false
;
39
}
40
41
private
:
42
const
char
*
title_
;
43
size_t
index_
;
44
};
45
46
}
// namespace openvpn
openvpn::IndexedTitle
Definition
indexed_title.hpp:23
openvpn::IndexedTitle::IndexedTitle
IndexedTitle(const char *title, const size_t index)
Definition
indexed_title.hpp:25
openvpn::IndexedTitle::index_
size_t index_
Definition
indexed_title.hpp:43
openvpn::IndexedTitle::to_string
std::string to_string() const
Definition
indexed_title.hpp:31
openvpn::IndexedTitle::title_
const char * title_
Definition
indexed_title.hpp:42
openvpn::IndexedTitle::empty
bool empty() const
Definition
indexed_title.hpp:36
openvpn
Definition
ovpncli.cpp:97
size.hpp
openvpn
common
indexed_title.hpp
Generated by
1.9.8