⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
userver
C++ Async Framework v2.0
Documentation
API Groups
Namespaces
Reference
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
w
y
Variables
k
n
r
u
w
Typedefs
c
d
h
m
n
o
p
s
t
u
v
Enumerations
a
b
c
d
f
h
i
l
o
p
r
s
t
u
v
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
y
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Typedefs
Enumerations
Enumerator
Related Symbols
File List
File Members
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
Toggle main menu visibility
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
Loading...
Searching...
No Matches
All results
bytes_per_second.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/utils/bytes_per_second.hpp
4
/// @brief @copybrief utils::BytesPerSecond
5
/// @ingroup userver_universal
6
7
#
include
<
string
>
8
9
#
include
<
userver
/
formats
/
parse
/
to
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
utils {
14
15
/// @ingroup userver_universal userver_containers
16
///
17
/// @brief Data type that represents `bytes per second` unit
18
enum
class
BytesPerSecond
:
long
long
{};
19
20
constexpr
long
long
ToLongLong(
BytesPerSecond
x) {
21
return
static_cast
<
long
long
>(x);
22
}
23
24
constexpr
bool
operator==(
BytesPerSecond
lhs,
BytesPerSecond
rhs) {
25
return
ToLongLong(lhs) == ToLongLong(rhs);
26
}
27
28
constexpr
bool
operator!=(
BytesPerSecond
lhs,
BytesPerSecond
rhs) {
29
return
!(lhs == rhs);
30
}
31
32
/// Understands all the date-rate unit suffixes from
33
/// https://en.wikipedia.org/wiki/Data-rate_units#Conversion_table
34
BytesPerSecond
StringToBytesPerSecond
(
const
std::string& data);
35
36
template
<
class
Value>
37
BytesPerSecond
Parse(
const
Value& v, formats::
parse
::
To
<
BytesPerSecond
>) {
38
return
StringToBytesPerSecond(v.
template
As<std::string>());
39
}
40
41
}
// namespace utils
42
43
USERVER_NAMESPACE_END
Docs version:
v1.0
,
v2.0
,
trunk/develop
userver
utils
bytes_per_second.hpp
Generated on Wed May 15 2024 22:34:26 for userver by
Doxygen
1.10.0