AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <CaptionLine.h>
Public Member Functions | |
CaptionLine (const std::string &text="", const std::vector< TextStyle > &styles={}) | |
std::vector< CaptionLine > | splitAtTextIndex (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< TextStyle > | styles |
Zero or more TextStyles that relate to m_text . More... | |
A single line of styled caption text.
alexaClientSDK::captions::CaptionLine::CaptionLine | ( | const std::string & | text = "" , |
const std::vector< TextStyle > & | styles = {} |
||
) |
Constructor.
captionText | The text content for this line of captions. |
textStyles | Zero or more styles with indices that match with the character indices in text . |
|
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()
.
captionLines | The caption lines to join together. |
bool alexaClientSDK::captions::CaptionLine::operator!= | ( | const CaptionLine & | rhs | ) | const |
Operator != for CaptionLine
.
rhs | The right hand side of the != operation. |
rhs
are not equivalent. bool alexaClientSDK::captions::CaptionLine::operator== | ( | const CaptionLine & | rhs | ) | const |
Operator == for CaptionLine
.
rhs | The right hand side of the == operation. |
rhs
are equivalent. 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.
index | The text index to determine where the text and style content should be divided. |
CaptionLine
objects whose unioned content equal the content of this CaptionLine
object. std::vector<TextStyle> alexaClientSDK::captions::CaptionLine::styles |
Zero or more TextStyles
that relate to m_text
.
std::string alexaClientSDK::captions::CaptionLine::text |
The text content for this line of captions.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0