AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
alexaClientSDK::captions::CaptionLine Struct Reference

#include <CaptionLine.h>

Public Member Functions

 CaptionLine (const std::string &text="", const std::vector< TextStyle > &styles={})
 
std::vector< CaptionLinesplitAtTextIndex (size_t index)
 
bool operator== (const CaptionLine &rhs) const
 
bool operator!= (const CaptionLine &rhs) const
 

Static Public Member Functions

static CaptionLine merge (std::vector< CaptionLine > captionLines)
 

Public Attributes

std::string text
 The text content for this line of captions. More...
 
std::vector< TextStylestyles
 Zero or more TextStyles that relate to m_text. More...
 

Detailed Description

A single line of styled caption text.

Constructor & Destructor Documentation

◆ CaptionLine()

alexaClientSDK::captions::CaptionLine::CaptionLine ( const std::string &  text = "",
const std::vector< TextStyle > &  styles = {} 
)

Constructor.

Parameters
captionTextThe text content for this line of captions.
textStylesZero or more styles with indices that match with the character indices in text.

Member Function Documentation

◆ merge()

static CaptionLine alexaClientSDK::captions::CaptionLine::merge ( std::vector< CaptionLine captionLines)
static

Joins multiple CaptionLine objects into a single CaptionLine, adjusting the character indices as needed for the styles. This is the inverse operation of CaptionLine::splitAtTextIndex().

Parameters
captionLinesThe caption lines to join together.

◆ operator!=()

bool alexaClientSDK::captions::CaptionLine::operator!= ( const CaptionLine rhs) const

Operator != for CaptionLine.

Parameters
rhsThe right hand side of the != operation.
Returns
Whether or not this instance and rhs are not equivalent.

◆ operator==()

bool alexaClientSDK::captions::CaptionLine::operator== ( const CaptionLine rhs) const

Operator == for CaptionLine.

Parameters
rhsThe right hand side of the == operation.
Returns
Whether or not this instance and rhs are equivalent.

◆ splitAtTextIndex()

std::vector<CaptionLine> alexaClientSDK::captions::CaptionLine::splitAtTextIndex ( size_t  index)

Clefts CaptionLine object in twain, at the text index specified. If the second CaptionLine starts with whitespace, then it will be removed and the indices will be adjusted. If the index given is greater than the text length, then the returned vector will contain only the current (unmodified) CaptionLine object.

Parameters
indexThe text index to determine where the text and style content should be divided.
Returns
One or two CaptionLine objects whose unioned content equal the content of this CaptionLine object.

Member Data Documentation

◆ styles

std::vector<TextStyle> alexaClientSDK::captions::CaptionLine::styles

Zero or more TextStyles that relate to m_text.

◆ text

std::string alexaClientSDK::captions::CaptionLine::text

The text content for this line of captions.


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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0