Path

High-level URL parsing utilities.

Overview

Typical use cases:

  • Parsing URLs into components

Header

<RaeptorCogs/IO/Path.hpp>

Metadata

Author

Estorc

Version

v1.0

Copyright

Copyright (c) 2025 Estorc MIT License.

Structs

Structures

Struct

Description

RaeptorCogs::URLParts

URL parts structure.

struct URLParts

URL parts structure.

Holds the domain and path components of a parsed URL.

Public Members

std::string protocol

The protocol part of the URL (e.g., “http”, “https”).

std::string domain

The domain part of the URL.

std::string path

The path part of the URL.

Functions

Functions

Function

Description

RaeptorCogs::ParseURL(const std::string_view &url)

Parse a URL into its components.

URLParts RaeptorCogs::ParseURL(const std::string_view &url)

Parse a URL into its components.

RaeptorCogs::URLParts parts = RaeptorCogs::ParseURL("https://example.com/path/to/resource");
std::cout << "Domain: " << parts.domain << ", Path: " << parts.path << std::endl;

Parameters:

url – The URL to parse.

Returns:

structure containing the domain and path.