plptools
Loading...
Searching...
No Matches
cliutils.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#pragma once
23
24#include "config.h"
25
26#include <string>
27
28namespace cli_utils {
29
30 extern bool is_number(const std::string &s);
31 extern int lookup_default_port();
32 extern bool parse_port(const std::string &arg, std::string *host, int *port);
33 extern bool parse_port(std::nullptr_t, std::string*, int*) = delete;
34
35};
bool parse_port(const std::string &arg, std::string *host, int *port)
Definition: cliutils.cc:53
bool is_number(const std::string &s)
Definition: cliutils.cc:35
int lookup_default_port()
Definition: cliutils.cc:44
decltype(nullptr) nullptr_t
Definition: doctest.h:523