Epok Engine

PSYQO SDK

psyqo::startsWith

Function · 1 overload

Function

Starts s with as part of the strings helpers module.

Belongs to
psyqo
Header
strings-helpers.hh
Overloads
1

Declaration

static
Declaration
static inline bool startsWith(const eastl::string_view &s1, const eastl::string_view &s2)

Starts s with as part of the strings helpers module.

ParameterTypeMeaning
s1const eastl::string_view &Value supplied for s1. Keep referenced or pointed-to data valid for the complete call.
s2const eastl::string_view &Value supplied for s2. Keep referenced or pointed-to data valid for the complete call.

Returns: bool. Check the value before continuing when it represents success, availability or a resource handle.

Example

C++ example
#include "psyqo/strings-helpers.hh"

// Assume these named values have been initialized with valid data:
// const eastl::string_view & s1
// const eastl::string_view & s2

auto result = psyqo::startsWith(s1, s2);

Why use it

The boolean result makes success, availability or state explicit without exceptions.

Trade-offs and warnings

Check the return value; `false` is part of normal control flow for many PSX resource operations. Pointer/reference arguments are borrowed unless the source contract says otherwise; keep them valid for the complete operation and never assume null is accepted.

Declared in https://github.com/pcsx-redux/nugget/blob/6186b131aacc5853a9161fb076ed34ffe504552d/psyqo/strings-helpers.hh:34

Related members