docs
Loading...
Searching...
No Matches
ClipboardValue

#include <Ultralight/ClipboardData.h>

Overview

A single clipboard value: empty, UTF-8 text, or raw bytes.

This is the variant value type of a ClipboardData entry. It converts between strings and buffers so you can pass either directly to ClipboardData::Set().

Public Member Functions

 ClipboardValue ()
 Create an empty value.
 ClipboardValue (std::nullptr_t)
 Create an empty value (lets you pass nullptr where a value is expected).
 ClipboardValue (const String &text)
 Create a text value.
 ClipboardValue (const char *text)
 Create a text value from a null-terminated UTF-8 string.
 ClipboardValue (RefPtr< Buffer > bytes)
 Create a bytes value (a null buffer creates an empty value).
 ClipboardValue (const ClipboardValue &other)
 Copy constructor.
ClipboardValue & operator= (const ClipboardValue &other)
 Copy assignment.
 ClipboardValue (ClipboardValue &&other) noexcept
 Move constructor (other becomes empty).
ClipboardValue & operator= (ClipboardValue &&other) noexcept
 Move assignment (other becomes empty).
 ~ClipboardValue ()
 Destructor.
bool is_empty () const
 Whether or not this value is empty (neither text nor bytes).
bool is_text () const
 Whether or not this value holds text.
bool is_bytes () const
 Whether or not this value holds raw bytes.
const String & text () const
 Get the text (an empty string when this value doesn't hold text).
RefPtr< Buffer > bytes () const
 Get the bytes (a null pointer when this value doesn't hold bytes).

Constructor & Destructor Documentation

◆ ClipboardValue() [1/7]

ClipboardValue ( )

Create an empty value.

◆ ClipboardValue() [2/7]

ClipboardValue ( std::nullptr_t )

Create an empty value (lets you pass nullptr where a value is expected).

◆ ClipboardValue() [3/7]

ClipboardValue ( const String & text)

Create a text value.

◆ ClipboardValue() [4/7]

ClipboardValue ( const char * text)

Create a text value from a null-terminated UTF-8 string.

◆ ClipboardValue() [5/7]

ClipboardValue ( RefPtr< Buffer > bytes)

Create a bytes value (a null buffer creates an empty value).

◆ ClipboardValue() [6/7]

ClipboardValue ( const ClipboardValue & other)

Copy constructor.

◆ ClipboardValue() [7/7]

ClipboardValue ( ClipboardValue && other)
noexcept

Move constructor (other becomes empty).

◆ ~ClipboardValue()

Destructor.

Member Function Documentation

◆ bytes()

RefPtr< Buffer > bytes ( ) const
nodiscard

Get the bytes (a null pointer when this value doesn't hold bytes).

◆ is_bytes()

bool is_bytes ( ) const
nodiscard

Whether or not this value holds raw bytes.

◆ is_empty()

bool is_empty ( ) const
nodiscard

Whether or not this value is empty (neither text nor bytes).

◆ is_text()

bool is_text ( ) const
nodiscard

Whether or not this value holds text.

◆ operator=() [1/2]

ClipboardValue & operator= ( ClipboardValue && other)
noexcept

Move assignment (other becomes empty).

◆ operator=() [2/2]

ClipboardValue & operator= ( const ClipboardValue & other)

Copy assignment.

◆ text()

const String & text ( ) const
nodiscard

Get the text (an empty string when this value doesn't hold text).


The documentation for this class was generated from the following file: