Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
parse_port.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Roc authors
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
7  */
8 
9 //! @file roc_pipeline/target_stdio/roc_pipeline/parse_port.h
10 //! @brief Parse port from string.
11 
12 #ifndef ROC_PIPELINE_PARSE_PORT_H_
13 #define ROC_PIPELINE_PARSE_PORT_H_
14 
15 #include "roc_pipeline/config.h"
16 #include "roc_pipeline/port.h"
17 
18 namespace roc {
19 namespace pipeline {
20 
21 //! Parse port from string.
22 //!
23 //! @remarks
24 //! The input string should be in one of the following forms:
25 //! - "PROTO::PORT" e.g. "rtp::123"
26 //! - "PROTO:IPv4:PORT" e.g. "rtp:1.2.3.4:123"
27 //! - "PROTO:[IPv6]:PORT" e.g. "rtp:[::1]:123"
28 //!
29 //! @returns
30 //! false if string can't be parsed.
31 bool parse_port(PortType type, const char* string, PortConfig& result);
32 
33 } // namespace pipeline
34 } // namespace roc
35 
36 #endif // ROC_PIPELINE_PARSE_PORT_H_
bool parse_port(PortType type, const char *string, PortConfig &result)
Parse port from string.
Pipeline config.
Root namespace.
Port constants.
PortType
Port type.
Definition: port.h:19