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

#include <IterativePlaylistParser.h>

Inheritance diagram for alexaClientSDK::playlistParser::IterativePlaylistParser:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::playlistParser::IterativePlaylistParser:
Collaboration graph
[legend]

Public Member Functions

IterativePlaylistParserInterface methods.
bool initializeParsing (std::string url) override
 
avsCommon::utils::playlistParser::PlaylistEntry next () override
 
void abort () override
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::playlistParser::IterativePlaylistParserInterface
virtual ~IterativePlaylistParserInterface ()=default
 

Static Public Member Functions

static std::unique_ptr< IterativePlaylistParsercreate (std::shared_ptr< avsCommon::sdkInterfaces::HTTPContentFetcherInterfaceFactoryInterface > contentFetcherFactory)
 

Detailed Description

This playlist parser implements an iterative depth first search algorithm to find audio urls inside a playlist url. Each call to next will perform the search until it hits a leaf (a valid media). When the playlist is empty, it will set the parse result to SUCCESS.

This class is not thread safe except for method abort(). This method can be called while another thread is running and it will cause ongoing and future calls to next to fail. Calls to initializeParsing will reset abort state.

Member Function Documentation

◆ abort()

void alexaClientSDK::playlistParser::IterativePlaylistParser::abort ( )
overridevirtual

Abort the current playlist parsing by causing ongoing and future calls to next to fail. Calls to initializeParsing will reset abort.

Implements alexaClientSDK::avsCommon::utils::playlistParser::IterativePlaylistParserInterface.

◆ create()

static std::unique_ptr<IterativePlaylistParser> alexaClientSDK::playlistParser::IterativePlaylistParser::create ( std::shared_ptr< avsCommon::sdkInterfaces::HTTPContentFetcherInterfaceFactoryInterface contentFetcherFactory)
static

Creates a new IterativePlaylistParser instance.

Parameters
contentFetcherFactoryA factory that can create HTTPContentFetcherInterfaces.
Returns
An std::unique_ptr to a new IterativePlaylistParser if successful or nullptr otherwise.

◆ initializeParsing()

bool alexaClientSDK::playlistParser::IterativePlaylistParser::initializeParsing ( std::string  url)
overridevirtual

Initialize the playlist parsing. Once succesfully initialized, the method next can be used to retrieve playlist entries.

Parameters
urlThe root url that can either point to one media file or a playlist to be parsed.
Returns
true if it succeeds; false otherwise.

Implements alexaClientSDK::avsCommon::utils::playlistParser::IterativePlaylistParserInterface.

◆ next()

avsCommon::utils::playlistParser::PlaylistEntry alexaClientSDK::playlistParser::IterativePlaylistParser::next ( )
overridevirtual

Get the next element in the playlist.

Returns
The parsing result. The url field will be valid if parseResult is different than ERROR.

Implements alexaClientSDK::avsCommon::utils::playlistParser::IterativePlaylistParserInterface.


The documentation for this class 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