JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::sync::ipc::limits Namespace Reference

Compile-time constraint and validation utilities for jh::sync::ipc. More...

Functions

template<jh::meta::TStr S, std::uint64_t MaxLen = max_name_length>
consteval bool valid_object_name ()
 Validate compile-time IPC object name (for semaphores, shared memory, etc.).
template<jh::meta::TStr S>
consteval bool valid_relative_path () noexcept
 Compile-time validation for POSIX-style relative paths.

Variables

constexpr std::uint64_t max_name_length = 128

Detailed Description

Compile-time constraint and validation utilities for jh::sync::ipc.

This namespace provides consteval-based helpers used to validate IPC object names and POSIX-style relative paths at compile time. It is an internal support layer and not intended for direct runtime use.

See also
jh::sync::ipc

Function Documentation

◆ valid_object_name()

template<jh::meta::TStr S, std::uint64_t MaxLen = max_name_length>
bool jh::sync::ipc::limits::valid_object_name ( )
consteval

Validate compile-time IPC object name (for semaphores, shared memory, etc.).

Rules

  • Length must be in range [1, MaxLen], default = 30 (BSD limit).
  • Allowed characters: [A-Za-z0-9_.-].
  • No leading '/' (automatically added by the OS namespace).

Template parameters

  • S — compile-time string representing base name.
  • MaxLen — optional override for system-specific maximum name length.
Returns
true if the name is valid, otherwise false.

◆ valid_relative_path()

template<jh::meta::TStr S>
bool jh::sync::ipc::limits::valid_relative_path ( )
constevalnoexcept

Compile-time validation for POSIX-style relative paths.

Rules

  • Length in range [1, 128].
  • Absolute paths forbidden (no leading '/').
  • No "./" segments.
  • ".." segments:
    • When JH_INTERPROCESS_ALLOW_PARENT_PATH == 0 → forbidden.
    • When JH_INTERPROCESS_ALLOW_PARENT_PATH == 1 → leading "../" allowed but cannot occupy entire path, and no ".." after content begins.
  • Allowed characters: [A-Za-z0-9_.-/].