![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
A mock content fetcher. More...
Public Member Functions | |
MockContentFetcher (const std::string &url) | |
std::string | getUrl () const override |
std::string | getEffectiveUrl () const override |
HTTPContentFetcherInterface::Header | getHeader (std::atomic< bool > *shouldShutdown) override |
HTTPContentFetcherInterface::State | getState () override |
bool | getBody (std::shared_ptr< avsCommon::avs::attachment::AttachmentWriter > writer) override |
void | shutdown () override |
std::unique_ptr< avsCommon::utils::HTTPContent > | getContent (FetchOptions fetchOption, std::unique_ptr< avsCommon::avs::attachment::AttachmentWriter > writer, const std::vector< std::string > &customHeaders=std::vector< std::string >()) override |
![]() | |
virtual | ~HTTPContentFetcherInterface ()=default |
virtual bool | getBody (std::shared_ptr< avsCommon::avs::attachment::AttachmentWriter > writer)=0 |
virtual std::unique_ptr< avsCommon::utils::HTTPContent > | getContent (FetchOptions option, std::unique_ptr< avsCommon::avs::attachment::AttachmentWriter > writer=nullptr, const std::vector< std::string > &customHeaders=std::vector< std::string >())=0 |
Additional Inherited Members | |
![]() | |
enum | FetchOptions { FetchOptions::CONTENT_TYPE, FetchOptions::ENTIRE_BODY } |
Represents what HTTP content to fetch. More... | |
enum | State { State::INITIALIZED, State::FETCHING_HEADER, State::HEADER_DONE, State::FETCHING_BODY, State::BODY_DONE, State::ERROR } |
The state of payload fetching. More... | |
![]() | |
static std::string | getUserAgent () |
static std::string | stateToString (State state) |
A mock content fetcher.
|
inline |
|
inlineoverride |
|
inlineoverride |
|
inlineoverridevirtual |
Gets the effective URL associated with this content fetcher.
Implements alexaClientSDK::avsCommon::sdkInterfaces::HTTPContentFetcherInterface.
|
inlineoverridevirtual |
Waits until the header was fetched successfully. If any problem happened during header, returns false
. After the header was already fetched, this method can be called multiple times and will return immediately.
shouldShutdown | A pointer to allow for the caller to asynchronously cancel the wait, if needed. this argument is optional. If it is a null pointer, the function will ignore it. |
Implements alexaClientSDK::avsCommon::sdkInterfaces::HTTPContentFetcherInterface.
|
inlineoverridevirtual |
The current content fetching state. In particular, a caller of getBody
, an asynchronous function, can use this method to monitor the download progress.
Implements alexaClientSDK::avsCommon::sdkInterfaces::HTTPContentFetcherInterface.
|
inlineoverridevirtual |
Gets the URL associated with this content fetcher
Implements alexaClientSDK::avsCommon::sdkInterfaces::HTTPContentFetcherInterface.
|
inlineoverridevirtual |
Shuts down the content fetcher.
Implements alexaClientSDK::avsCommon::sdkInterfaces::HTTPContentFetcherInterface.
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0