Skip to Content
⚠ Under Construction
ReferenceC++ APIBanEntry

endstone::BanEntry

A single entry from a ban list.

Types:

NameDescription
Date

Attributes:

NameDescription
DateFormat

Functions:

NameDescription
getCreatedGets the date this ban entry was created.
getExpirationGets the date this ban expires on, or std::nullopt for no defined end date.
getReasonGets the reason for this ban.
getSourceGets the source of this ban.
setCreatedSets the date this ban entry was created.
setExpirationSets the date this ban expires on. std::nullopt values are considered “infinite” bans.
setReasonSets the reason for this ban.
setSourceSets the source of this ban.

Date

using endstone::BanEntry::Date = std::chrono::system_clock::time_point;

DateFormat

const std::string endstone::BanEntry::DateFormat;

getCreated

Date getCreated() const

Gets the date this ban entry was created.

Returns:

the creation date

getExpiration

std::optional<Date> getExpiration() const

Gets the date this ban expires on, or std::nullopt for no defined end date.

Returns:

the expiration date

getReason

std::string getReason() const

Gets the reason for this ban.

Returns:

the ban reason

getSource

std::string getSource() const

Gets the source of this ban.

Returns:

the source of the ban

setCreated

void setCreated(Date created)

Sets the date this ban entry was created.

Parameters:

  • created the new created date

See also: save() saving changes

setExpiration

void setExpiration(std::optional<Date> expiration)

Sets the date this ban expires on. std::nullopt values are considered “infinite” bans.

Parameters:

  • expiration the new expiration date, or std::nullopt to indicate an infinite ban

setReason

void setReason(std::string reason)

Sets the reason for this ban.

Parameters:

  • reason the new reason, empty values assume the implementation default

See also: save() saving changes

setSource

void setSource(std::string source)

Sets the source of this ban.

Parameters:

  • source the new source

See also: save() saving changes

Last updated on