plptools
Loading...
Searching...
No Matches
cli_utils.h
Go to the documentation of this file.
1/*
2 * This file is part of plptools.
3 *
4 * Copyright (C) 1999 Philip Proudman <philip.proudman@btinternet.com>
5 * Copyright (C) 1999-2002 Fritz Elfert <felfert@to.com>
6 * Copyright (C) 2026 Jason Morley <hello@jbmorley.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * along with this program; if not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23#pragma once
24
25#include "config.h"
26
27#include <string>
28
29namespace cli_utils {
30
31 extern bool is_number(const std::string &s);
32 extern int lookup_default_port();
33 extern bool parse_port(const std::string &arg, std::string *host, int *port);
34 extern bool parse_port(std::nullptr_t, std::string*, int*) = delete;
35
36};
bool parse_port(const std::string &arg, std::string *host, int *port)
Definition: cli_utils.cc:52
bool is_number(const std::string &s)
Definition: cli_utils.cc:34
int lookup_default_port()
Definition: cli_utils.cc:43
decltype(nullptr) nullptr_t
Definition: doctest.h:523