FPathViews::SplitFirstComponent

Split the given absolute or relative path into its topmost directory and the relative path from that directory.

Choose your operating system:

Windows

macOS

Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Misc/PathViews.h

Include

#include "Misc/PathViews.h"

Source

/Engine/Source/Runtime/Core/Private/Misc/PathViews.cpp

Syntax

static void SplitFirstComponent
(
    FStringView InPath,
    FStringView & OutFirstComponent,
    FStringView & OutRemainder
)

Remarks

Split the given absolute or relative path into its topmost directory and the relative path from that directory. Directory elements of . and .. are currently not interpreted and are treated as literal characters. Callers should not rely on this behavior as it may be corrected in the future. callers should instead conform the paths before calling.

Parameters

Parameter

Description

InPath

The path to split.

OutFirstComponent

Receives the first directory element in the path, or InPath if it is a leaf path.

OutRemainder

Receives the relative path from OutFirstComponent to InPath, or empty if InPath is a leaf path.